From 3e8dc2a84d36db826d5aaee5cac10375125d90f9 Mon Sep 17 00:00:00 2001 From: Balazs Keresztury Date: Tue, 23 Oct 2018 01:17:50 +0200 Subject: [PATCH] Expanded MQTT section to include embedded broker option, added new example and links --- Home-Assistant.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Home-Assistant.md b/Home-Assistant.md index 7a289890..6e32d9df 100644 --- a/Home-Assistant.md +++ b/Home-Assistant.md @@ -21,7 +21,21 @@ In the examples shown the Sonoff-Tasmota parameters are set: ## MQTT broker -As Sonoff-Tasmota is MQTT based you will need to configure Home Assistant to [connect to an MQTT broker](https://home-assistant.io/components/mqtt/). You can use the following configuration to an MQTT server with the hostname ``domus1``. +As Sonoff-Tasmota is [MQTT](https://www.home-assistant.io/components/mqtt/) based you will need to configure Home Assistant to connect to an MQTT broker. + +Home Assistant comes with an [embedded MQTT broker](https://www.home-assistant.io/docs/mqtt/broker#embedded-broker) which is easy to set up but you may want to opt for a [separate MQTT broker](https://www.home-assistant.io/docs/mqtt/broker#run-your-own) instead for better stability. A popular choice for this is the open-source [Eclipse Mosquitto](https://mosquitto.org/). + +### Configure the embedded broker +```yaml +# Example configuration.yaml entry +mqtt: + password: hello +``` + +Default username is `homeassistant` while port defaults to `1883`. + +### Configure an external broker +In the following configuration example an external MQTT server is used with the hostname ``domus1``: ```yaml mqtt: broker: domus1 @@ -43,7 +57,9 @@ mqtt: retain: false ``` -Retained messages explanation: [video](https://youtube.com/watch?v=31IyfM1gygo) +The `retain` option plays an important role in persisting states over restarts and other disruptions. If you experience that states are out of sync you probably want to review your configuration. + +An in depth explanation about MQTT `retain` is available [in this video](https://youtube.com/watch?v=31IyfM1gygo). ## Switch