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

Support Aqara light bulb #103

Closed
spairault opened this issue Dec 19, 2018 · 17 comments
Closed

Support Aqara light bulb #103

spairault opened this issue Dec 19, 2018 · 17 comments

Comments

@spairault
Copy link

Hello,

Aqara launch few weeks ago a new zigbee light bulb. It's seems very nice.
Do you planned to support it ?

https://www.gearbest.com/smart-bulb/pp_009892485950.html?wid=1433363
https://www.youtube.com/watch?v=SoLRTNLrh-o

Thanks a lot for your hard work.

Regards,

@fairecasoimeme
Copy link
Owner

Hi,
I'll order the bulb and test.
I'll update the compatibility section.

Thanks for informations
Fred.

@spairault
Copy link
Author

Great news! Thx a lot.

@cpainchaud
Copy link

I have one connected to Zigate -> HomeAssistant via https://github.com/doudz/homeassistant-zigate plugin

Everything works fine BUT color temperature selection. The light bulb does not offer RGB colros but only temperature

@doudz
Copy link
Contributor

doudz commented Jan 11, 2019

Maybe it's related to my homeassistant component.
Could you share the zigate.json file ?

@cpainchaud
Copy link

cpainchaud commented Jan 11, 2019

{
    "devices": [
        {
            "addr": "80ed",
            "discovery": "templated",
            "endpoints": [
                {
                    "clusters": [
                        {
                            "attributes": [
                                {
                                    "attribute": 1,
                                    "data": 3,
                                    "name": "application_version",
                                    "value": 3
                                },
                                {
                                    "attribute": 4,
                                    "data": "LUMI",
                                    "name": "manufacturer",
                                    "value": "LUMI"
                                },
                                {
                                    "attribute": 5,
                                    "data": "lumi.sensor_switch.aq2",
                                    "name": "type",
                                    "type": "str",
                                    "value": "lumi.sensor_switch.aq2"
                                },
                                {
                                    "attribute": 65281,
                                    "data": "0121030c03280f0421a81305211f00062401000000000a210000",
                                    "name": "battery",
                                    "unit": "V",
                                    "value": 3.075
                                }
                            ],
                            "cluster": 0
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 0,
                                    "data": true,
                                    "inverse": true,
                                    "name": "onoff",
                                    "type": "bool",
                                    "value": false
                                },
                                {
                                    "attribute": 32768,
                                    "data": 0,
                                    "expire": 2,
                                    "name": "multiclick",
                                    "type": "int",
                                    "value": 0
                                }
                            ],
                            "cluster": 6
                        }
                    ],
                    "device": 24321,
                    "endpoint": 1,
                    "in_clusters": [
                        0,
                        65535,
                        6
                    ],
                    "out_clusters": [
                        0,
                        4,
                        65535
                    ],
                    "profile": 260
                }
            ],
            "generictype": "sensor",
            "info": {
                "addr": "80ed",
                "bit_field": "0100000000000010",
                "descriptor_capability": "00000000",
                "id": 1,
                "ieee": "00158d000204402b",
                "last_seen": "2019-01-11 12:06:42",
                "mac_capability": "10000000",
                "manufacturer_code": "1037",
                "power_type": 0,
                "rssi": 84,
                "server_mask": 0
            }
        },
        {
            "addr": "fedd",
            "discovery": "",
            "endpoints": [
                {
                    "clusters": [
                        {
                            "attributes": [
                                {
                                    "attribute": 65281,
                                    "data": "01213b0b0328150421a80105210c0006240100010000082108030a21000098212800992100009a25c8ff79009c04",
                                    "name": "battery",
                                    "unit": "V",
                                    "value": 2.875
                                }
                            ],
                            "cluster": 0
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 1288,
                                    "data": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
                                },
                                {
                                    "attribute": 1283,
                                    "data": 0.0,
                                    "expire": 2,
                                    "name": "rotation",
                                    "type": "float",
                                    "unit": "\u00b0",
                                    "value": 0.0
                                },
                                {
                                    "attribute": 85,
                                    "data": "",
                                    "expire": 2,
                                    "expire_value": "",
                                    "name": "movement",
                                    "type": "str",
                                    "value": ""
                                },
                                {
                                    "attribute": 1285,
                                    "data": 1769472
                                }
                            ],
                            "cluster": 257
                        }
                    ],
                    "device": 0,
                    "endpoint": 1,
                    "in_clusters": [],
                    "out_clusters": [],
                    "profile": 0
                }
            ],
            "generictype": "",
            "info": {
                "addr": "fedd",
                "id": 2,
                "ieee": "00158d0002b716c6",
                "last_seen": "2019-01-10 17:07:11",
                "mac_capability": "10000000",
                "power_type": 0,
                "rssi": 72
            }
        },
        {
            "addr": "ad7f",
            "discovery": "templated",
            "endpoints": [
                {
                    "clusters": [
                        {
                            "attributes": [
                                {
                                    "attribute": 1,
                                    "data": 3,
                                    "name": "application_version",
                                    "value": 3
                                },
                                {
                                    "attribute": 4,
                                    "data": "LUMI",
                                    "name": "manufacturer",
                                    "value": "LUMI"
                                },
                                {
                                    "attribute": 5,
                                    "data": "lumi.sensor_switch.aq2",
                                    "name": "type",
                                    "type": "str",
                                    "value": "lumi.sensor_switch.aq2"
                                },
                                {
                                    "attribute": 65281,
                                    "data": "0121f90b0328170421a81305211000062402000001010a210000",
                                    "name": "battery",
                                    "unit": "V",
                                    "value": 3.065
                                }
                            ],
                            "cluster": 0
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 0,
                                    "data": true,
                                    "inverse": true,
                                    "name": "onoff",
                                    "type": "bool",
                                    "value": false
                                },
                                {
                                    "attribute": 32768,
                                    "data": 0,
                                    "expire": 2,
                                    "name": "multiclick",
                                    "type": "int",
                                    "value": 0
                                }
                            ],
                            "cluster": 6
                        }
                    ],
                    "device": 24321,
                    "endpoint": 1,
                    "in_clusters": [
                        0,
                        65535,
                        6
                    ],
                    "out_clusters": [
                        0,
                        4,
                        65535
                    ],
                    "profile": 260
                }
            ],
            "generictype": "sensor",
            "info": {
                "addr": "ad7f",
                "bit_field": "0100000000000010",
                "descriptor_capability": "00000000",
                "id": 0,
                "ieee": "00158d00020df913",
                "last_seen": "2019-01-11 11:52:09",
                "mac_capability": "10000000",
                "manufacturer_code": "1037",
                "power_type": 0,
                "rssi": 48,
                "server_mask": 0
            }
        },
        {
            "addr": "9bb9",
            "discovery": "auto-discovered",
            "endpoints": [
                {
                    "clusters": [
                        {
                            "attributes": [
                                {
                                    "attribute": 1,
                                    "data": 22,
                                    "name": "application_version",
                                    "value": 22
                                },
                                {
                                    "attribute": 5,
                                    "data": "lumi.light.aqcn02",
                                    "name": "type",
                                    "type": "str",
                                    "value": "lumi.light.aqcn02"
                                },
                                {
                                    "attribute": 6,
                                    "data": "09-30-2018",
                                    "name": "datecode",
                                    "value": "09-30-2018"
                                }
                            ],
                            "cluster": 0
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 0,
                                    "data": 254,
                                    "name": "current_level",
                                    "type": "int",
                                    "value": 100
                                },
                                {
                                    "attribute": 61440,
                                    "data": 10205440
                                }
                            ],
                            "cluster": 8
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 0,
                                    "data": false,
                                    "name": "onoff",
                                    "type": "bool",
                                    "value": false
                                },
                                {
                                    "attribute": 61440,
                                    "data": 10205440
                                }
                            ],
                            "cluster": 6
                        }
                    ],
                    "device": 258,
                    "endpoint": 1,
                    "in_clusters": [
                        0,
                        4,
                        3,
                        5,
                        10,
                        258,
                        13,
                        19,
                        6,
                        1,
                        1030,
                        8,
                        768,
                        1027,
                        1029,
                        1026
                    ],
                    "out_clusters": [
                        25,
                        10,
                        13,
                        258,
                        19,
                        6,
                        1,
                        1030,
                        8,
                        768
                    ],
                    "profile": 260
                }
            ],
            "generictype": "",
            "info": {
                "addr": "9bb9",
                "id": 50,
                "ieee": "00158d0002c65701",
                "last_seen": "2019-01-10 17:09:41",
                "mac_capability": "10001110",
                "power_type": 1,
                "rssi": 114
            }
        }
    ],
    "groups": {},
    "scenes": {}
}

@doudz
Copy link
Contributor

doudz commented Jan 11, 2019

Could you call the service "discover_device" on that bulb, I think it will solve the problem. If not try to restart HA

@cpainchaud
Copy link

discover_services has triggered a hundreds of errors like this:
2019-01-11 12:44:51 DEBUG (ZiGate-Listen) [zigate] Raw packet received, b'\x01\x80\x02\x10\x02\x10\x02\x15?\x15\xee\x02\x11@\x02\x10\x03'
2019-01-11 12:44:51 DEBUG (ZiGate-Event Loop) [zigate] Dispatch ZIGATE_PACKET_RECEIVED
2019-01-11 12:44:51 DEBUG (ZiGate-Decode data) [zigate] Received response 0x8000: b'15ee0140'
2019-01-11 12:44:51 DEBUG (ZiGate-Decode data) [zigate] RESPONSE 0x8000 - Status response : status:21, sequence:238, packet_type:320, error:b'', rssi:0
2019-01-11 12:44:51 DEBUG (ZiGate-Decode data) [zigate] Dispatch ZIGATE_RESPONSE_RECEIVED
2019-01-11 12:44:51 ERROR (ZiGate-Decode data) [zigate] Command 0x0140 failed Failed (ZigBee event codes) 21 : b''
2019-01-11 12:44:51 DEBUG (Thread-13) [zigate] STATUS code to command 0x0140:21

I am now trying a restart of ha

@cpainchaud
Copy link

cpainchaud commented Jan 11, 2019

Restart didnt help. For odd reasons I had to re-join the bulb.
After rejoining, the bulb is working (on+off) but still no option to pick a color temperature.

updates json:

{
    "devices": [
        {
            "addr": "fedd",
            "discovery": "",
            "endpoints": [
                {
                    "clusters": [
                        {
                            "attributes": [
                                {
                                    "attribute": 65281,
                                    "data": "01213b0b0328150421a80105210c0006240100010000082108030a21000098212800992100009a25c8ff79009c04",
                                    "name": "battery",
                                    "unit": "V",
                                    "value": 2.875
                                }
                            ],
                            "cluster": 0
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 1288,
                                    "data": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
                                },
                                {
                                    "attribute": 1283,
                                    "data": 0.0,
                                    "expire": 2,
                                    "name": "rotation",
                                    "type": "float",
                                    "unit": "\u00b0",
                                    "value": 0.0
                                },
                                {
                                    "attribute": 85,
                                    "data": "",
                                    "expire": 2,
                                    "expire_value": "",
                                    "name": "movement",
                                    "type": "str",
                                    "value": ""
                                },
                                {
                                    "attribute": 1285,
                                    "data": 1769472
                                }
                            ],
                            "cluster": 257
                        }
                    ],
                    "device": 0,
                    "endpoint": 1,
                    "in_clusters": [],
                    "out_clusters": [],
                    "profile": 0
                }
            ],
            "generictype": "",
            "info": {
                "addr": "fedd",
                "id": 2,
                "ieee": "00158d0002b716c6",
                "last_seen": "2019-01-10 17:07:11",
                "mac_capability": "10000000",
                "power_type": 0,
                "rssi": 72
            }
        },
        {
            "addr": "ad7f",
            "discovery": "templated",
            "endpoints": [
                {
                    "clusters": [
                        {
                            "attributes": [
                                {
                                    "attribute": 1,
                                    "data": 3,
                                    "name": "application_version",
                                    "value": 3
                                },
                                {
                                    "attribute": 4,
                                    "data": "LUMI",
                                    "name": "manufacturer",
                                    "value": "LUMI"
                                },
                                {
                                    "attribute": 5,
                                    "data": "lumi.sensor_switch.aq2",
                                    "name": "type",
                                    "type": "str",
                                    "value": "lumi.sensor_switch.aq2"
                                },
                                {
                                    "attribute": 65281,
                                    "data": "0121f90b0328170421a81305211000062402000001010a210000",
                                    "name": "battery",
                                    "unit": "V",
                                    "value": 3.065
                                }
                            ],
                            "cluster": 0
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 0,
                                    "data": true,
                                    "inverse": true,
                                    "name": "onoff",
                                    "type": "bool",
                                    "value": false
                                },
                                {
                                    "attribute": 32768,
                                    "data": 0,
                                    "expire": 2,
                                    "name": "multiclick",
                                    "type": "int",
                                    "value": 0
                                }
                            ],
                            "cluster": 6
                        }
                    ],
                    "device": 24321,
                    "endpoint": 1,
                    "in_clusters": [
                        0,
                        65535,
                        6
                    ],
                    "out_clusters": [
                        0,
                        4,
                        65535
                    ],
                    "profile": 260
                }
            ],
            "generictype": "sensor",
            "info": {
                "addr": "ad7f",
                "bit_field": "0100000000000010",
                "descriptor_capability": "00000000",
                "id": 0,
                "ieee": "00158d00020df913",
                "last_seen": "2019-01-11 11:52:09",
                "mac_capability": "10000000",
                "manufacturer_code": "1037",
                "power_type": 0,
                "rssi": 59,
                "server_mask": 0
            }
        },
        {
            "addr": "7df3",
            "discovery": "auto-discovered",
            "endpoints": [
                {
                    "clusters": [
                        {
                            "attributes": [
                                {
                                    "attribute": 1,
                                    "data": 22,
                                    "name": "application_version",
                                    "value": 22
                                },
                                {
                                    "attribute": 5,
                                    "data": "lumi.light.aqcn02",
                                    "name": "type",
                                    "type": "str",
                                    "value": "lumi.light.aqcn02"
                                },
                                {
                                    "attribute": 6,
                                    "data": "09-30-2018",
                                    "name": "datecode",
                                    "value": "09-30-2018"
                                }
                            ],
                            "cluster": 0
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 0,
                                    "data": 254,
                                    "name": "current_level",
                                    "type": "int",
                                    "value": 100
                                },
                                {
                                    "attribute": 61440,
                                    "data": 10205440
                                }
                            ],
                            "cluster": 8
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 0,
                                    "data": true,
                                    "name": "onoff",
                                    "type": "bool",
                                    "value": true
                                },
                                {
                                    "attribute": 61440,
                                    "data": 8254208
                                }
                            ],
                            "cluster": 6
                        }
                    ],
                    "device": 258,
                    "endpoint": 1,
                    "in_clusters": [
                        0,
                        4,
                        3,
                        5,
                        10,
                        258,
                        13,
                        19,
                        6,
                        1,
                        1030,
                        8,
                        768,
                        1027,
                        1029,
                        1026
                    ],
                    "out_clusters": [
                        25,
                        10,
                        13,
                        258,
                        19,
                        6,
                        1,
                        1030,
                        8,
                        768
                    ],
                    "profile": 260
                }
            ],
            "generictype": "",
            "info": {
                "addr": "7df3",
                "id": 50,
                "ieee": "00158d0002c65701",
                "last_seen": "2019-01-11 12:56:58",
                "mac_capability": "10001110",
                "power_type": 1,
                "rssi": 69
            }
        },
        {
            "addr": "80ed",
            "discovery": "templated",
            "endpoints": [
                {
                    "clusters": [
                        {
                            "attributes": [
                                {
                                    "attribute": 1,
                                    "data": 3,
                                    "name": "application_version",
                                    "value": 3
                                },
                                {
                                    "attribute": 4,
                                    "data": "LUMI",
                                    "name": "manufacturer",
                                    "value": "LUMI"
                                },
                                {
                                    "attribute": 5,
                                    "data": "lumi.sensor_switch.aq2",
                                    "name": "type",
                                    "type": "str",
                                    "value": "lumi.sensor_switch.aq2"
                                },
                                {
                                    "attribute": 65281,
                                    "data": "0121030c03280f0421a81305211f00062401000000000a210000",
                                    "name": "battery",
                                    "unit": "V",
                                    "value": 3.075
                                }
                            ],
                            "cluster": 0
                        },
                        {
                            "attributes": [
                                {
                                    "attribute": 0,
                                    "data": true,
                                    "inverse": true,
                                    "name": "onoff",
                                    "type": "bool",
                                    "value": false
                                },
                                {
                                    "attribute": 32768,
                                    "data": 0,
                                    "expire": 2,
                                    "name": "multiclick",
                                    "type": "int",
                                    "value": 0
                                }
                            ],
                            "cluster": 6
                        }
                    ],
                    "device": 24321,
                    "endpoint": 1,
                    "in_clusters": [
                        0,
                        65535,
                        6
                    ],
                    "out_clusters": [
                        0,
                        4,
                        65535
                    ],
                    "profile": 260
                }
            ],
            "generictype": "sensor",
            "info": {
                "addr": "80ed",
                "bit_field": "0100000000000010",
                "descriptor_capability": "00000000",
                "id": 1,
                "ieee": "00158d000204402b",
                "last_seen": "2019-01-11 12:56:54",
                "mac_capability": "10000000",
                "manufacturer_code": "1037",
                "power_type": 0,
                "rssi": 84,
                "server_mask": 0
            }
        }
    ],
    "groups": {},
    "scenes": {}
}```

screenshot of homeassistant:
[image](https://user-images.githubusercontent.com/6696638/51035136-50c11c00-15a9-11e9-83ae-28727370b33a.png)

@pipiche38
Copy link

I'm waiting for receiving one in the next couple of days.
But it looks like we are in the Xiaomi world and it looks that Cluster 12 is used ... I got a similar informations ...

@doudz
Copy link
Contributor

doudz commented Jan 11, 2019

Ok I got it, the problem is related to device id, it's 0x0102 so according to zigbee doc, it's supposed to have color
I open a issue on my side since it's a problem in the python lib
doudz/zigate#69

@cpainchaud
Copy link

ok for the record, model number from xiaomi is : ZNLDP12LM

@cpainchaud
Copy link

cpainchaud commented Jan 14, 2019

Doudz's patch in his library fixed my Colour Temperature issue BUT i have a new one : after a few hours/days the bulb becomes unesponsive : it wont turn on/off anymore.

What kind of logs can I forward? I can provide Doudz's Zigate python lib output eventually....

@pipiche38
Copy link

Interesting Bulb.
Seems that Aqara is using Cluster 0000 with Attribute ff01 to send some additional information on regular basic.

Tag: 6420 give you OnOff state 00 or 01
Tag: 6520 give you the Level state 01 to FF
Tag 6621 don't know yet. It is most-likely related to the WW

In addition there is also attribute f000 on cluster 0300

@cpainchaud
Copy link

Yes @pipiche38 , it's actually the only way I can see to get state of the lamp if someone takes it manually on/off with an electric switch

@pipiche38
Copy link

The tag 6621 looks strange for me, and then I need also to understand the 0x0300/f000 , which seems to be in relation with WW variation. 2 messages are sent.

Need to see the pattern. but have also some other challenges ;-)

@pipiche38
Copy link

From my end this one can be close, as the Aqara builb is fully supported, no ?

@pipiche38
Copy link

Aqara bulb works very well with Zigate. This should be close

@ISO-B ISO-B closed this as completed Jul 15, 2019
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

No branches or pull requests

6 participants