Hi Guys, I have some question about automation, here’s an example automation I create with UI help.
- id: '1575184069670'
alias: Turn on light
trigger:
device_id: myswitch
domain: switch
entity_id: switch.shenzhen_neo_electronics_co_ltd_power_plug_12a_switch_3
platform: device
type: turned_on
action:
device_id: mylights
domain: light
entity_id: light.warehouse
type: turn_on
My question is, what is device_id ? I tried to change it to whatever I like it seems ok, but when I delete it, an error occurred, but I looked everywhere on tutorial or examples, they dont need device_id, and domain in their automation, why do it cant work on mine ?
Second question about zigbee, I have an aqara double switch, but seems I can’t find a working example of how to automate it, i tried automation like this
- alias: Switch Hue Light
trigger:
platform: mqtt
topic: 'zigbee2mqtt/0x00158d0002fcedf9_click'
condition:
condition: template
value_template: '{{ "single" == trigger.payload_json.click }}'
action:
service: light.toggle
entity_id: light.warehouse
But it won’t work, in zigbee2mqtt, my aqara switch shows as follows
zigbee2mqtt:info 2019-12-08T02:45:01: MQTT publish: topic 'zigbee2mqtt/0x00158d0002fcedf9', payload '{"battery":100,"voltage":3045,"linkquality":65,"click":"left"}'
zigbee2mqtt:info 2019-12-08T02:45:01: MQTT publish: topic 'zigbee2mqtt/0x00158d0002fcedf9', payload '{"battery":100,"voltage":3045,"linkquality":65,"click":""}'
PS: I’m using CC2531 USB Stick for zigbee