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:
1 parent
ba70d364b1
commit
16815f51da
9 files changed
+389
-103
No files matched your search
@@ -112,7 +112,9 @@ void announceDeviceTrigger(bool use_gateway_info,
|
||||
char* device_model,
|
||||
char* device_mac);
|
||||
|
||||
#define discovery_Topic "homeassistant"
|
||||
#ifndef discovery_Topic
|
||||
# define discovery_Topic "homeassistant"
|
||||
#endif
|
||||
// discovery_republish_on_reconnect false to publish discovery topics over MQTT only with first connect
|
||||
// discovery_republish_on_reconnect true to always republish discovery topics over MQTT when connection is re-established
|
||||
#ifndef discovery_republish_on_reconnect
|
||||
@@ -254,6 +256,13 @@ const char* availableHASSUnits[] = {"W",
|
||||
"bpm",
|
||||
"dB",
|
||||
"dBm",
|
||||
"B"};
|
||||
"B",
|
||||
"UV index",
|
||||
"m/s",
|
||||
"km/h",
|
||||
"°",
|
||||
"mm",
|
||||
"mm/h",
|
||||
"cm"};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user