Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Device Support Request] Aqara Ceiling light T1M #3066

Open
corvis opened this issue Mar 24, 2024 · 1 comment · May be fixed by #3070
Open

[Device Support Request] Aqara Ceiling light T1M #3066

corvis opened this issue Mar 24, 2024 · 1 comment · May be fixed by #3070

Comments

@corvis
Copy link
Contributor

corvis commented Mar 24, 2024

Problem description

Device works fine in general both main light and rgb ring were identified automatically and work fine. However there is not power_outage_memory which is pretty important to me.

Device identifies itself as lumi.light.acn032.

Solution description

I noticed zigbee2mqtt added this recently. So I tried to replicate this:
image

With a quirk like this:

class LumiBasicCluster(CustomCluster, Basic):
    """Hue Motion Basic cluster."""
    manufacturer_id_override = 4447

    attributes = BasicCluster.attributes.copy()
    attributes[0xFF19] = ZCLAttributeDef(
        id=0xFF19, type=t.Bool, access=ZCLAttributeAccess.Write, is_manufacturer_specific=True,
        name="power_outage_memory"
    )


class LumiLightAcn032(XiaomiCustomDevice):
    """
    Aqara Light T1M (ceiling light with RGB ring).
    This quirk adds support for power on behavior by adding the power_outage_memory attribute, the rest works out
    of the box.

    It MIGHT also work for the Model T1 (acn031) but it has not been tested.
    """
    signature = {
        MODELS_INFO: [("Aqara", "lumi.light.acn032"), ],
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COLOR_DIMMABLE_LIGHT,
                INPUT_CLUSTERS: [
                    BasicCluster.cluster_id,  # 0x0000
                    Identify.cluster_id,  # 0x0003
                    Groups.cluster_id,  # 0x0004
                    Scenes.cluster_id,  # 0x0005
                    OnOff.cluster_id,  # 0x0006
                    LevelControl.cluster_id,  # 0x0008
                    Color.cluster_id,  # 0x0300
                    OppleClusterLightGen2.cluster_id,  # 0xFCC0 - manufacturer specific
                ],
                OUTPUT_CLUSTERS: [
                    Time.cluster_id,  # 0x000A
                    Ota.cluster_id,  # 0x0019
                ],
            },
            2: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COLOR_DIMMABLE_LIGHT,
                INPUT_CLUSTERS: [
                    Identify.cluster_id,  # 0x0003
                    Groups.cluster_id,  # 0x0004
                    Scenes.cluster_id,  # 0x0005
                    OnOff.cluster_id,  # 0x0006
                    LevelControl.cluster_id,  # 0x0008
                    Color.cluster_id,  # 0x0300
                    0xFCC0,  # 0xFCC0 - manufacturer specific
                ],
                OUTPUT_CLUSTERS: [],
            }
        }
    }
    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COLOR_DIMMABLE_LIGHT,
                INPUT_CLUSTERS: [
                    LumiBasicCluster,
                    Identify.cluster_id,  # 0x0003
                    Groups.cluster_id,  # 0x0004
                    Scenes.cluster_id,  # 0x0005
                    OnOff.cluster_id,  # 0x0006
                    LevelControl.cluster_id,  # 0x0008
                    Color.cluster_id,  # 0x0300
                    0xFCC0,
                ],
                OUTPUT_CLUSTERS: [
                    Time.cluster_id,  # 0x000A
                    Ota.cluster_id,  # 0x0019
                ],
            },
            2: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.COLOR_DIMMABLE_LIGHT,
                INPUT_CLUSTERS: [
                    Identify.cluster_id,  # 0x0003
                    Groups.cluster_id,  # 0x0004
                    Scenes.cluster_id,  # 0x0005
                    OnOff.cluster_id,  # 0x0006
                    LevelControl.cluster_id,  # 0x0008
                    Color.cluster_id,  # 0x0300
                    # OppleClusterLightGen2,
                    0xFCC0,
                ],
                OUTPUT_CLUSTERS: [],
            }
        }
    }

Unfortunately it doesn't work. When I send set attribute message the response is UNSUPPORTED ATTRIBUTE.

Maybe my quirk is incorrect and it doesn't replicate zigbee2mqtt behavior, or maybe someone has any ideas how to fix this? any help will be highly appertained.

@corvis
Copy link
Contributor Author

corvis commented Mar 25, 2024

After a bit more debugging I found the solution. Here is the PR.

@corvis corvis linked a pull request Mar 25, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant