energy values as HA sensors with classes, v3.6.1-dev0e

This commit is contained in:
MichaelDvP
2023-09-04 16:37:58 +02:00
parent 06e9b8d303
commit f1034f4230
2 changed files with 6 additions and 2 deletions

View File

@@ -847,7 +847,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
case DeviceValueType::UINT:
case DeviceValueType::SHORT:
case DeviceValueType::USHORT:
case DeviceValueType::ULONG:
// case DeviceValueType::ULONG:
if (discovery_type() == discoveryType::HOMEASSISTANT) {
// Home Assistant
// number - https://www.home-assistant.io/integrations/number.mqtt
@@ -866,6 +866,10 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
// select - https://www.home-assistant.io/integrations/select.mqtt
snprintf(topic, sizeof(topic), "select/%s", config_topic);
break;
case DeviceValueType::ULONG:
snprintf(topic, sizeof(topic), "sensor/%s", config_topic);
set_ha_classes = true;
break;
default:
// plain old sensor
snprintf(topic, sizeof(topic), "sensor/%s", config_topic);