Add respond to button clicks example.

This commit is contained in:
Koen Kanters
2018-04-21 23:01:52 +02:00
parent 2e20798aef
commit f584b5dcca
+18
View File
@@ -127,6 +127,24 @@ text += ' discovery: true\n'
text += '```\n'
text += '\n\n'
text += 'To respond to button clicks you can use the following home assistant configuration:\n'
text += '```yaml'
text += `
automation:
- alias: Respond to button clicks
trigger:
platform: mqtt
topic: 'zigbee2mqtt/<FRIENDLY_NAME'
condition:
condition: template
value_template: "{{ 'single' == trigger.payload_json.click }}"
action:
entity_id: light.bedroom
service: light.toggle
`
text += '```\n'
text += 'In case you **dont** want to use home assistants MQTT discovery you can use the configuration below.\n\n'
const homeassistantConfig = (device) => {