elric91 / homeassistant_zigate

Custom components for Home Assistant
MIT License
22 stars 5 forks source link

Aqara Smart Light Control #1

Open RiRomain opened 6 years ago

RiRomain commented 6 years ago

To help development, here are the log from the Aqara Smart Light Control (wall switch)

The log are watch is received when I press the key. My switch are the one with the integrated relay, so when I press the button, the light are also turned ON or OFF.

Turn left switch OFF Turn left switch ON Turn right switch Off.txt Turn right switch On.txt

ISO-B commented 6 years ago

That wall switch has lots of endpoints. All my devices only have 1. This is interesting. It seems that both buttons have two endpoints: one providing button state and other to tell that button is pressed.

Could you provide more data? I copied address from logs, so if commands are not working make sure device still has same address.

z.send_data('0042', '3BCF') Node Descriptor (lots of device info) z.send_data('0043', '3BCF01') Cluster List from endpoint 01 (Common) z.send_data('0043', '3BCF02') Cluster List from endpoint 02 (Left button: State) z.send_data('0043', '3BCF03') Cluster List from endpoint 03 (Right button: State) z.send_data('0043', '3BCF04') Cluster List from endpoint 04 (Left button: Press) z.send_data('0043', '3BCF05') Cluster List from endpoint 05 (Right button: Press) z.send_data('0044', '3BCF') Power info z.send_data('0045', '3BCF') Endpoint listing

RiRomain commented 6 years ago

Here are the result of the different command:

Cluster_List_from_endpoint_01.txt Cluster_List_from_endpoint_02.txt Cluster_List_from_endpoint_03.txt Cluster_List_from_endpoint_04.txt Cluster_List_from_endpoint_05.txt Endpoint_listing.txt Node_Descriptor.txt Power_info.txt

Edit: Both lamp/relay were ON during those call.

ISO-B commented 6 years ago

Does these commands do same as pressing left button? With these you should be able to set state to desired. Left button on: z.send_data('0092', '023BCF010201') Left button off: z.send_data('0092', '023BCF010200')

Try this if command above didn't do the trick. Running both of these should simulate button press. Left button pressed down: z.send_data('0092', '023BCF010400') Left button released: z.send_data('0092', '023BCF010401')

RiRomain commented 6 years ago

Yes, working perfectly with the first command, here are the log of the left switch being turned on and turned off:

Turn_Off_Left_Light.txt Turn_On_Left_Light.txt

ISO-B commented 6 years ago

Only thing that I am not sure about is attribute id f000 in cluster 0006 in endpoints 02 and 03. It might tell if switch happened by using button or from network. When attribute data is 03030303 it was triggered by button and 07070707 it is triggered by network. Should be easy to confirm by switching it couple times with hand and command and see if attribute id is consistently same.

RiRomain commented 6 years ago

I tested your theory several time and I can confirm that it is correct.

03030303 when the button is used. 07070707 when ZigBee is used

biau commented 6 years ago

Is there someone to give me a hint how to replicate the state value in home assistant when I manually turn ON / OFF the switch ? First I do not have the same endpoint as RiRomain, on my double key wall switch with fireline to turn on / off lights from HA I use endpoint 01 and 02. I attach logs turning ON / OFF the light using both methods: HA and the switch. turn_on_ha.log turn_off_ha.log turn_on_wall.log turn_off_wall.log

My config is

switch:
  - platform: zigate
    name: 'Cuisine central'
    address: "84c301"
  - platform: zigate
    name: 'Cuisine table'
    address: "84c302"