Auto discovery deactivation at runtime by MQTT command (#856)

and switch automatic creation for it in HASS (by autodiscovery :-)
This commit is contained in:
Florian authored and GitHub committed 2021-01-31 13:41:22 -06:00
1 parent e8b4c63c6c
commit 2d377a1c3f
9 files changed
+94 -26

No files matched your search

+27
View File
@@ -52,3 +52,30 @@ home/OpenMQTTGateway/SRFBtoMQTT/59365 {"raw":"2B660186042E00E7E5","value":"59365
```
It can be usefull to avoid warning or errors on certain controllers.
## Auto discovery
Home Assistant discovery is enabled by default on all binaries and platformio configurations except for UNO. With Arduino IDE you have to uncomment [ZmqttDiscovery](https://github.com/1technophile/OpenMQTTGateway/blob/0180a0dbd55ed8e0799e30ee84f68070a6f478fa/User_config.h#L99) in User_config.h.
To have a working discovery setup you need to enable it on your MQTT integration definition in HASS.
::: tip
With platformio you can deactivate discovery by adding:
``` ini
'-UZmqttDiscovery="HADiscovery"'
```
To your environment definition.
:::
So as to create the MQTT username and password, you have to create a new user(recommended) into Home Assistant->Configuration->Users (available in admin mode) or use an existing username/pwd combination (not recommended). This user doesn't need to be an administrator.
![](../img/OpenMQTTGateway-Configuration-Home-Assistant.png)
::: warning
The max size of the username is 30 and 60 for the password.
:::
OMG will use the auto discovery functionality of home assistant to create sensors and gateways into your HASS instance automaticaly.
The gateway device will be available into Configuration->Devices section of Home Assistant.
![](../img/OpenMQTTGateway_Home_Assistant_MQTT_discovery.png)