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

Add support for lumi.light.acn031 & lumi.light.acn032 #7203

Merged
merged 9 commits into from
Mar 14, 2024

Conversation

banister4728
Copy link
Contributor

White and RGB light works. Only thing found not working is that the RGB color can't be changed within Zigbee2MQTT but works fine in HA.

@Koenkk
Copy link
Owner

Koenkk commented Mar 12, 2024

Can you try with the following code:

    {
        zigbeeModel: ['lumi.light.acn031', 'lumi.light.acn032'],
        model: 'T1/T1m',
        vendor: 'Aqara',
        description: 'Ceiling light T1/T1m',
        meta: {multiEndpoint: true},
        endpoint: () => ({white: 1, rgb: 2}),
        fromZigbee: light({colorTemp: {range: [153, 370]}, color: true}).fromZigbee,
        toZigbee: light({colorTemp: {range: [153, 370]}, color: true}).toZigbee,
        exposes: [
            // White light: On/Off, brightness, color temperature, no color_temp_startup
            e.light_brightness_colortemp([153, 370]).removeFeature('color_temp_startup').withEndpoint('white'),
            // [Notification Light]
            e.light_brightness_colorxy().withEndpoint('rgb'),
        ],
    },

@banister4728
Copy link
Contributor Author

Can you try with the following code:

    {
        zigbeeModel: ['lumi.light.acn031', 'lumi.light.acn032'],
        model: 'T1/T1m',
        vendor: 'Aqara',
        description: 'Ceiling light T1/T1m',
        meta: {multiEndpoint: true},
        endpoint: () => ({white: 1, rgb: 2}),
        fromZigbee: light({colorTemp: {range: [153, 370]}, color: true}).fromZigbee,
        toZigbee: light({colorTemp: {range: [153, 370]}, color: true}).toZigbee,
        exposes: [
            // White light: On/Off, brightness, color temperature, no color_temp_startup
            e.light_brightness_colortemp([153, 370]).removeFeature('color_temp_startup').withEndpoint('white'),
            // [Notification Light]
            e.light_brightness_colorxy().withEndpoint('rgb'),
        ],
    },

Works! Only thing left now is changing of color via ZB2MQTT dashboard doesn't work, although changing via HA works. Thank you so much.

@mrskycriper
Copy link
Contributor

mrskycriper commented Mar 13, 2024

Modern extend from the start would be welcome

Can you test this instead of meta, endpoint, fromZigbee, toZigbee and exposes?

extend: [
  deviceEndpoints({endpoints: {'white': 1, 'rgb': 2}}),
  lumiLight({colorTemp: true, powerOutageMemory: 'light', endpointNames: ['white']}),
  lumiLight({colorTemp: true, color: {modes: ['xy', 'hs']}, endpointNames: ['rgb']}),
  lumiZigbeeOTA()
],

@banister4728
Copy link
Contributor Author

@mrskycriper Not sure why the check failed but your code works when I used it as a external converter.

@Koenkk Koenkk merged commit a18cdee into Koenkk:master Mar 14, 2024
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Mar 14, 2024

thanks!

@corvis
Copy link

corvis commented Mar 24, 2024

@banister4728 can you confirm if powerOutageMemory function actually works?

@banister4728
Copy link
Contributor Author

@corvis Don't think it works. When i click on it in zb2mqtt exposes tab, I get the following:

Publish 'set' 'power_outage_memory' to 'ceilinglight' failed: 'Error: Write 0x54ef4410008f1023/1 genBasic({"65305":{"value":1,"type":16}}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4447,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Status 'UNSUPPORTED_ATTRIBUTE')'

@corvis
Copy link

corvis commented Mar 25, 2024

Thanks for checking. I replicated this ZHA quirk and got the same result so wanted to check if the original was actually working.

Are there any ideas how to make it work?

@mrskycriper
Copy link
Contributor

mrskycriper commented Mar 25, 2024

It probably uses different attribute here. Maybe it's just binary?

There are 2 main attributes for this in use by Lumi devices

UPD.

Why is this converter using genBasic... That is most likely not correct anymore. The attribute is probably on manuSpecificLumi cluster

@corvis
Copy link

corvis commented Mar 25, 2024

After some more debugging I think I nailed it. I'm not zigbee2mqtt user so I can't propose a PR but maybe this will be helpful.

Power behavior of this device is controlled by the following attribute:

Cluster: 0xFCC0 # Manufacturer Specific
Endpoint: 0x01
Attribute: 0x0517
Type: 0x20 # 8-bit int
Manufacturer Code: 4447
Value: 
    0x00 - Always On (default) - Will be turned on after power outage.
    0x01 - Preserve State - Will keep the state it was before power outage.
    0x02 - Always Off - Will be turned off after power outage.

This needs to be configured just for endpoint 1 (main light), the light ring will inherit this configuration.

@mrskycriper
Copy link
Contributor

lumiLight definitely needs an update

@corvis
Copy link

corvis commented Mar 25, 2024

I created PR to ZHA, maybe it will be helpful for the developer who will be working on PR to zigbee2mqtt: zigpy/zha-device-handlers#3070

@banister4728
Copy link
Contributor Author

banister4728 commented Mar 27, 2024

I created PR to ZHA, maybe it will be helpful for the developer who will be working on PR to zigbee2mqtt: zigpy/zha-device-handlers#3070

Unfortunately this is beyond my capability. @Koenkk @mrskycriper are you able to help?

@corvis Are you able to control the RGB animation on zha?

@corvis
Copy link

corvis commented Mar 27, 2024

Are you able to control the RGB animation on zha?

No

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 this pull request may close these issues.

None yet

4 participants