Add device_class to MQTT Discovery for rtl_433_ESP (#1419)

* Add device_class to rtl_433_ESP discovery
This commit is contained in:
Northern Man authored and GitHub committed 2023-01-25 09:58:18 -06:00
1 parent 9bdfeca2f7
commit dcb4d5551e
2 files changed
+44 -44

No files matched your search

+41 -41
View File
@@ -82,47 +82,47 @@ struct RTL_433device {
extern std::vector<RTL_433device*> RTL_433devices;
const char parameters[39][3][16] = {
// RTL_433 key, name, unit
{"temperature_C", "temperature", "°C"},
{"temperature_1_C", "temperature", "°C"},
{"temperature_2_C", "temperature", "°C"},
{"temperature_F", "temperature", "°F"},
{"time", "timestamp", ""},
{"battery_ok", "battery", ""},
{"humidity", "humidity", "%"},
{"moisture", "moisture", "%"},
{"pressure_hPa", "pressure", "hPa"},
{"pressure_kPa", "pressure", "kPa"},
{"wind_speed_km_h", "wind speed", "km/h"},
{"wind_avg_km_h", "wind average", "km/h"},
{"wind_avg_mi_h", "wind average", "mi/h"},
{"wind_avg_m_s", "wind average", "m/s"},
{"wind_speed_m_s", "wind speed", "m/s"},
{"gust_speed_km_h", "gust speed", "km/h"},
{"wind_max_km_h", "wind max", "km/h"},
{"wind_max_m_s", "wind max", "m/s"},
{"gust_speed_m_s", "gust speed", "m/s"},
{"wind_dir_deg", "wind direction", "°"},
{"rain_mm", "rain", "mm"},
{"rain_mm_h", "rain", "mm/h"},
{"rain_in", "rain", "in"},
{"rain_rate_in_h", "rain", "in/h"},
{"rssi", "rssi", "dB"},
{"snr", "snr", "dB"},
{"noise", "noise", "dB"},
{"depth_cm", "depth", "cm"},
{"power_W", "power", "W"},
{"light_lux", "light", "lx"},
{"lux", "lux", "lx"},
{"uv", "uv", "UV index"},
{"uvi", "uvi", "UV index"},
{"storm_dist", "storm distance", "mi"},
{"strike_distance", "strike distance", "mi"},
{"tamper", "tamper", ""},
{"alarm", "alarm", ""},
{"motion", "motion", ""},
{"strike_count", "strike count", ""}}; // from rtl_433_mqtt_hass.py
const char parameters[39][4][24] = {
// RTL_433 key, name, unit, device_class
{"temperature_C", "temperature", "°C", "temperature"},
{"temperature_1_C", "temperature", "°C", "temperature"},
{"temperature_2_C", "temperature", "°C", "temperature"},
{"temperature_F", "temperature", "°F", "temperature"},
{"time", "timestamp", "", "timestamp"},
{"battery_ok", "battery", "", "battery"},
{"humidity", "humidity", "%", "humidity"},
{"moisture", "moisture", "%", "humidity"},
{"pressure_hPa", "pressure", "hPa", "pressure"},
{"pressure_kPa", "pressure", "kPa", "pressure"},
{"wind_speed_km_h", "wind speed", "km/h", "wind_speed"},
{"wind_avg_km_h", "wind average", "km/h", "wind_speed"},
{"wind_avg_mi_h", "wind average", "mi/h", "wind_speed"},
{"wind_avg_m_s", "wind average", "m/s", "wind_speed"},
{"wind_speed_m_s", "wind speed", "m/s", "wind_speed"},
{"gust_speed_km_h", "gust speed", "km/h", "wind_speed"},
{"wind_max_km_h", "wind max", "km/h", "wind_speed"},
{"wind_max_m_s", "wind max", "m/s", "wind_speed"},
{"gust_speed_m_s", "gust speed", "m/s", "wind_speed"},
{"wind_dir_deg", "wind direction", "°", ""},
{"rain_mm", "rain", "mm", "precipitation"},
{"rain_mm_h", "rain", "mm/h", "precipitation"},
{"rain_in", "rain", "in", "precipitation_intensity"},
{"rain_rate_in_h", "rain", "in/h", "precipitation_intensity"},
{"rssi", "rssi", "dB", "signal_strength"},
{"snr", "snr", "dB", ""},
{"noise", "noise", "dB", ""},
{"depth_cm", "depth", "cm", ""},
{"power_W", "power", "W", "power"},
{"light_lux", "light", "lx", ""},
{"lux", "lux", "lx", ""},
{"uv", "uv", "UV index", ""},
{"uvi", "uvi", "UV index", ""},
{"storm_dist", "storm distance", "mi", ""},
{"strike_distance", "strike distance", "mi", ""},
{"tamper", "tamper", "", ""},
{"alarm", "alarm", "", ""},
{"motion", "motion", "", "motion"},
{"strike_count", "strike count", "", ""}}; // from rtl_433_mqtt_hass.py
# endif
#endif
/*-------------------RF topics & parameters----------------------*/