HASS gateway Discovery improvements (#792)

* MQTT discovery improvements

-remove gatewayBT
-remove device class formaldehyde (not existing in HASS)
-add SYStoMQTT new parameters
-attach connectivity parameter to the device
-add BT gateway infos and switches
-refactor modules storage and publication
This commit is contained in:
Florian authored and GitHub committed 2020-11-04 11:53:55 -06:00
1 parent cabc8695eb
commit 9a66c9ef09
7 files changed
+136 -104

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

+7 -2
View File
@@ -1,10 +1,15 @@
# Integrate Home Assistant
## Auto discovery
So as to enable HASS auto discovery with MQTT you have to uncomment [ZmqttDiscovery](https://github.com/1technophile/OpenMQTTGateway/blob/0180a0dbd55ed8e0799e30ee84f68070a6f478fa/User_config.h#L99) in User_config.h
And enable discovery on your MQTT integration definition in HASS.
So as to enable HASS auto discovery with MQTT you have to uncomment [ZmqttDiscovery](https://github.com/1technophile/OpenMQTTGateway/blob/0180a0dbd55ed8e0799e30ee84f68070a6f478fa/User_config.h#L99) in User_config.h. Note that Home Assistant discovery is enabled by default on all binaries and platformio configurations except for UNO.
Once done, enable discovery on your MQTT integration definition in HASS.
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)
## Manual integration examples
From @123, @finity, @denniz03, @jrockstad
+8
View File
@@ -85,6 +85,10 @@ you can also force a scan to be done by the following command:
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"interval":0}'`
::: tip
With Home Assistant, this command is directly avalaible through MQTT auto discovery as a switch into the HASS OpenMQTTGateway device entities list.
:::
Once the forced scan has completed, the previous scan interval value will be restored. Forcing a scan command trigger also a BLE connect process after the scan (see below).
The default value `TimeBtwRead` is set into config_BT.h or into your .ini file for platformio users.
@@ -107,6 +111,10 @@ If you want to change this characteristic:
`mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"onlysensors":true}'`
::: tip
With Home Assistant, this command is directly avalaible through MQTT auto discovery as a switch into the HASS OpenMQTTGateway device entities list.
:::
The gateway will publish only the detected sensors like Mi Flora, Mi jia, LYWSD03MMC... and not the other BLE devices. This is usefull if you don't use the gateway for presence detection but only to retrieve sensors data.
## Setting the minimum RSSI accepted to publish device data
+8 -1
View File
@@ -1,13 +1,20 @@
# System commands (ESP only)
## Restart the ESP
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m '{"cmd":"restart"}'`
::: tip
With Home Assistant, this command is directly avalaible through MQTT auto discovery as a switch into the HASS OpenMQTTGateway device entities list.
:::
## Erase the ESP settings
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m '{"cmd":"erase"}'`
::: tip
With Home Assistant, this command is directly avalaible through MQTT auto discovery as a switch into the HASS OpenMQTTGateway device entities list.
:::
# State LED usage
The gateway can support up to 3 LED to display its operating state: