@@ -532,7 +532,7 @@ void Mqtt::ha_status() {
532
532
doc[" obj_id" ] = uniq;
533
533
534
534
doc[" stat_t" ] = mqtt_basename_ + " /status" ;
535
- doc[" name" ] = " system status" ;
535
+ doc[" name" ] = " System status" ;
536
536
doc[" pl_on" ] = " online" ;
537
537
doc[" pl_off" ] = " offline" ;
538
538
doc[" stat_cla" ] = " measurement" ;
@@ -855,14 +855,11 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
855
855
case DeviceValueType::UINT:
856
856
case DeviceValueType::SHORT:
857
857
case DeviceValueType::USHORT:
858
- // case DeviceValueType::ULONG:
859
858
if (discovery_type () == discoveryType::HOMEASSISTANT) {
860
- // Home Assistant
861
859
// number - https://www.home-assistant.io/integrations/number.mqtt
862
860
snprintf (topic, sizeof (topic), " number/%s" , config_topic);
863
861
} else {
864
- // Domoticz
865
- // Does not support number, use sensor
862
+ // Domoticz does not support number, use sensor
866
863
snprintf (topic, sizeof (topic), " sensor/%s" , config_topic);
867
864
}
868
865
break ;
@@ -1126,9 +1123,8 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
1126
1123
}
1127
1124
1128
1125
// add category "diagnostic" for system entities
1129
- if (device_type == EMSdevice::DeviceType::SYSTEM) {
1130
- doc[" ent_cat" ] = " diagnostic" ;
1131
- }
1126
+ // config for writeable entities, like switches. diagnostic for read only sensors.
1127
+ doc[" ent_cat" ] = (has_cmd) ? " config" : " diagnostic" ;
1132
1128
1133
1129
// add the dev json object to the end
1134
1130
doc[" dev" ] = dev_json;
0 commit comments