doudz / zigate

python lib for zigate
MIT License
46 stars 22 forks source link

Device 0x0102 should have color actions #69

Closed doudz closed 5 years ago

doudz commented 5 years ago

see https://github.com/fairecasoimeme/ZiGate/issues/103

{
            "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
            }
        },
doudz commented 5 years ago
Lighting 0x0100 ON/OFF Light
0x0101 Dimmable Light
0x0102 Color Dimmable Light
0x0103 ON/OFF Light Switch
0x0104 Dimmer Switch
0x0105 Color Dimmer Switch
0x0106 Light Sensor
0x0107 Occupancy Sensor
cpainchaud commented 5 years ago

model number : ZNLDP12LM

cpainchaud commented 5 years ago

The doc says color temperature can be adjusted from 2700K to 6500K

doudz commented 5 years ago

it's a bit strange, device id 0x0102 is supposed to be HUE not temperature colour, but why not.. another thing strange, there's cluster 0x0402 temperature, 0x0403 pressure, 0x405 humidity, 0x0406 occupancy, what a full featured bulb ;) I supposed most of the clusters are not working

cpainchaud commented 5 years ago

Who knows, Xiaomi may have secret plans :)

How do I update this component in HASS to test your commit?

doudz commented 5 years ago

To test you can set REQUIREMENTS like this : REQUIREMENTS = ['https://github.com/doudz/zigate/archive/dev.zip#0.26.0.dev0']

cpainchaud commented 5 years ago

awesome job, it works perfectly !