Closed arkpoah closed 4 years ago
I use the device entity because binary_sensor does not work with the button : #79
If you don't care about the multiclic, you can use an event trigger (instead of state).
The event to listen is zigate.attribute_updated
zigate.attribute_updated event works fine but it is triggered for all zigate devices ^^ When I try to filter on one entity, it does not work anymore, I do it like that :
- alias: 'Allumer/Eteindre spots cuisine'
trigger:
- platform: event
event_type: zigate.attribute_updated
event_data:
entity_id: binary_sensor.zigate_00158d000214f0ad_onoff
action:
service: switch.toggle
entity_id: switch.qubino_goap_zmnhadx_flush_1_relay_switch
Do I miss something ?
The entity_id is the zigate entity so zigate.000158d000214f0ad for you.
yes I tried that first but same behavior
I can't provide an example because I'm using nodered for automation but here's what I can see in the payload of an attribute_update event:
{"event_type":"zigate.attribute_updated","entity_id":"zigate.00158d0002d7bb59","event":{"endpoint":1,"cluster":6,"addr":"7376","attribute":0,"data":true,"name":"onoff","type":"bool","value":true,"ieee":"00158d0002d7bb59","device_type":"lumi.relay.c2acn01","entity_id":"zigate.00158d0002d7bb59"}}
I'm not at home right now so I can't confirm, but I think you need to filter on value: true
.
Otherwise, you'll receive 2 events, one when you press and one when you release the button, which will toggle your lights 2 times.
Also, your entity_id
is zigate.00158d0002d7bb59
, not anything else
Ok it works fine, I think I done a typo to zigate_ instead of zigate. Thx !
anyway, issue is still there, every 50 minutes, state is auto updated and event attribute_updated is triggered...
Do you filter value in the event ? Because maybe your device is just reporting attributes.
You should filter on event.cluster = 6 and event.value = true
Here is the trigger I use for my automation, and it works perfectly:
trigger:
- platform: event
event_type: zigate.attribute_updated
event_data:
entity_id: zigate.xxxxxxxxxxxx
name: onoff
value: true
I confirm it works correctly with more filters, thx.
Hello,
I'm using a Xiaomi Aqara single button and I created an automation to use it :
This works fine, the state changes when I push button and automation is triggered.
The issue is that the state changes alone every 50 minutes, is there something sent to device every 50min ? I have no more automation wich could interact with it. I see same behavior with my Xiaomi door sensor.
I use Zigate Wifi with 3.1a firmware.
Thanks