I am trying to make an wireless button work in an automation.
I have paired it successfully in zigbee2mqtt and it also shows the diffent actions like “single”. “double” and so on when looking in development tools.
Anyway nothing happens in my automation.
This is what I have done. Can someone see what is wrong?
zigbee2mqtt
devices:
'0x00158d0001a3fd19':
friendly_name: switch_kitchen
sensor:
- platform: "mqtt"
name: "switch_kitchen"
state_topic: "zigbee2mqtt/switch_kitchen"
availability_topic: "zigbee2mqtt/bridge/state"
value_template: "{{ value_json.click }}"
automation:
- alias: Kitchen TOGGLE when SINGLE PRESS
trigger:
- platform: mqtt
topic: 'zigbee2mqtt/switch_kitchen'
condition:
- condition: template
value_template: '{{ "single" == trigger.payload_json.click }}'
action:
- service: light.toggle
entity_id: light.kitchen