From 3ecf92fa410291d3027a095fd451da5c840a1095 Mon Sep 17 00:00:00 2001 From: Proddy Date: Tue, 12 Oct 2021 12:59:00 +0200 Subject: [PATCH] add times as a new HA UOM - #156 --- CHANGELOG_LATEST.md | 6 +++++- src/emsdevice.cpp | 1 + src/emsdevice.h | 8 ++++---- src/locale_EN.h | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index cf543e04f..28e24a5fc 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -12,6 +12,7 @@ - Support for Junkers program and remote (fb10/fb110) temperature - Home Assistant `state_class` attribute for Wh, kWh, W and KW [#129](https://github.com/emsesp/EMS-ESP32/issues/129) - Add current room influence for RC300[#136] +- Added Home Assistant device_class to sensor entities ## Fixed @@ -28,10 +29,13 @@ - "unit" renamed to "uom" in API call to recall a Device Value - initial backend React changes to replace the class components (HOCs) with React Hooks - Use program-names instead of numbers +- Boiler's maintenancemessage always published in MQTT (to prevent HA missing entity) +- Unit of Measure 'times' added to MQTT Fails, Rx fails, Rx received, Tx fails, Tx reads & Tx writes ## **BREAKING CHANGES** - API: "unit" renamed to "uom" in API call to recall a Device Value - HA: `sensor.boiler_boiler_temperature` renamed to `sensor.actual_boiler_temperature` - HA: `binary_sensor.boiler_ww_disinfecting` renamed to `binary_sensor.boiler_ww_disinfection` - \ No newline at end of file +- HA: # removed from counts in MQTT Fails, Rx fails, Rx received, Tx fails, Tx reads & Tx writes +- `txread` renamed to `txreads` and `txwrite` renamed to `txwrites` in MQTT heartbeat payload diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 7a2556cfb..dc213825b 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -40,6 +40,7 @@ static const __FlashStringHelper * DeviceValueUOM_s[] __attribute__((__aligned__ F_(seconds), F_(dbm), F_(mv), + F_(times), F_(oclock) }; diff --git a/src/emsdevice.h b/src/emsdevice.h index 560726c98..8e4aa2191 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -44,9 +44,8 @@ enum DeviceValueType : uint8_t { }; -// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp -// uom - also used with HA -// sequence is important! +// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp. Sequence is important!! +// also used with HA as uom enum DeviceValueUOM : uint8_t { NONE = 0, // 0 @@ -65,7 +64,8 @@ enum DeviceValueUOM : uint8_t { SECONDS, // 13 DBM, // 14 MV, // 15 - OCLOCK // 16 + TIMES, // 16 + OCLOCK // 17 }; diff --git a/src/locale_EN.h b/src/locale_EN.h index 4606a61e7..132187fd9 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -184,6 +184,7 @@ MAKE_PSTR(kb, "KB") MAKE_PSTR(seconds, "seconds") MAKE_PSTR(dbm, "dBm") MAKE_PSTR(mv, "mV") +MAKE_PSTR(times, "times") MAKE_PSTR(oclock, "o'clock") // TAG mapping - maps to DeviceValueTAG_s in emsdevice.cpp