Add RTL_433 discovery with Home Assistant convention inspired from rtl_433_mqtt_hass.py (#1379)

This also changes the topic structure when using the macro valueAsATopic=true, it adds as sub-topics the `type, subtype, and channel` when they exist.
The id is the last subtopic to facilitate filtering, as it may change when replacing the batteries.

Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com>
This commit is contained in:
FlorianandNorthernMan54 authored and GitHub committed 2023-01-07 20:34:43 -06:00
1 parent ba70d364b1
commit 16815f51da
9 files changed
+389 -103

No files matched your search

+36 -3
View File
@@ -33,6 +33,42 @@ OMG will use the auto discovery functionality of home assistant to create gatewa
![](../img/OpenMQTTGateway_Home_Assistant_MQTT_discovery.png)
::: info
The Bluetooth and the RTL_433 gateway will create automatically devices and entities, the RF gateway will create DeviceTrigger.
The OpenMQTTGateway will also be available as a device to monitor its parameters and control it. The sensors (DHT for example) and actuators (relays) are attached to the gateway.
:::
## RTL_433 auto discovery specificity
Even if the RTL_433 gateway will create automatically the devices and entities, you may loose the link to them when you change the batteries. This is proper to the RF devices. In this case new device and entities will be created. You may bypass this by creating entities through manual configuration that filter following the device model and other parameters and don't take into account the id.
Example:
```yaml
mqtt:
sensor:
- state_topic: "+/+/RTL_433toMQTT/WS2032/+"
```
instead of
```yaml
mqtt:
sensor:
- state_topic: "+/+/RTL_433toMQTT/WS2032/47998"
```
Note also that the sensor may leverage channels, types or subtypes, they can be used in the filtering
Example:
In the example below 9 is the `subtype` and 1 is the `channel`
```yaml
mqtt:
sensor:
- state_topic: "+/+/RTL_433toMQTT/Prologue-TH/9/1/+"
```
instead of
```yaml
mqtt:
sensor:
- state_topic: "+/+/RTL_433toMQTT/Prologue-TH/9/1/215"
```
Alternatively the rssi signal could be used also.
## MQTT Device Trigger and RF
@@ -40,9 +76,6 @@ With OpenMQTTGateway [configured to receive RF signals](./setitup/rf.html) the m
With autodiscovery enabled, HomeAssistant will discover a [MQTT Device Trigger](https://www.home-assistant.io/integrations/device_trigger.mqtt/) identified by the value field given in the mqtt argument.
## Manual integration examples
From @123, @finity, @denniz03, @jrockstad, @anarchking, @dkluivingh
+1 -2
View File
@@ -250,7 +250,7 @@ This feature is only available on a ESP32 based device with a supported transcei
### Supported hardware combinations
- ESP32 based device with a CC1101 transceiver
- Heltec WiFi LoRa 32 (V2.1)
- Heltec WiFi LoRa 32 (V2.1) and LilyGo Lora 32 V2.1
### Supported Decoders
@@ -349,7 +349,6 @@ Delta applied to RSSI floor noise level to determine start and end of signal, de
`home/OpenMQTTGateway/commands/MQTTtoRTL_433 {"rssi": 9}`
### Retrieve current status of receiver
`home/OpenMQTTGateway/commands/MQTTtoRTL_433 {"status":1}`