From b0cdcf2e2161bb6076f93a51ecb71a6144bde988 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 13 Jun 2018 20:28:35 +0200 Subject: [PATCH] Update docgen for homeassistant. --- support/docgen.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/support/docgen.js b/support/docgen.js index 32df8e0e..aaae021b 100644 --- a/support/docgen.js +++ b/support/docgen.js @@ -47,16 +47,26 @@ fs.writeFileSync(outputdir + '/' + file, text); file = 'Integrating-with-Home-Assistant.md'; text = '*NOTE: Automatically generated by `npm run docgen`*\n\n'; text += 'If you\'re hosting zigbee2mqtt using [this hassio addon-on](https://github.com/danielwelch/hassio-zigbee2mqtt) use their documentation on how to configure.\n\n' -text += 'The easiest way to integrate zigbee2mqtt with Home Assistant is by using [MQTT discovery](https://www.home-assistant.io/docs/mqtt/discovery/).' -text += ' To enable MQTT discovery set `homeassistant: true` in your zigbee2mqtt `configuration.yaml` and add the following to your Home Assistant `configuration.yaml`.\n' -text += '```yaml\n' -text += 'mqtt:\n' -text += ' discovery: true\n' -text += '```\n' +text += 'The easiest way to integrate zigbee2mqtt with Home Assistant is by using [MQTT discovery](https://www.home-assistant.io/docs/mqtt/discovery/).\n\n' +text += 'To achieve the best possible integration (including MQTT discovery):\n'; +text += '- In your **zigbee2mqtt** `configuration.yaml` set `homeassistant: true`\n' +text += '- In your **Home Assistant** `configuration.yaml`:\n'; + +text += '```yaml'; +text += 'mqtt:'; +text += ' discovery: true'; +text += ' broker: [YOUR MQTT BROKER]'; +text += ' birth_message:'; +text += ` topic: 'hass/status'`; +text += ` payload: 'online'`; +text += ' will_message:'; +text += ` topic: 'hass/status'`; +text += ` payload: 'offline'`; +text += '```'; text += '\n\n' -text += 'To respond to button clicks you can use the following Home Assistant configuration:\n' +text += 'To respond to button clicks (e.g. WXKG01LM) you can use the following Home Assistant configuration:\n' text += '```yaml' text += ` automation: