From 628f845b166e57e18a70e6e8b2abe682c6683ca4 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 31 Oct 2024 22:28:53 +0100 Subject: [PATCH] value_json['%s']['%s'] for Domoticz (to test) --- src/mqtt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mqtt.cpp b/src/mqtt.cpp index f20bb34d8..6d3ec2c17 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -1102,7 +1102,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev char val_obj[100]; char val_cond[200]; if (is_nested() && tag >= DeviceValueTAG::TAG_HC1) { - snprintf(val_obj, sizeof(val_obj), "value_json.%s['%s']", EMSdevice::tag_to_mqtt(tag), entity); + snprintf(val_obj, sizeof(val_obj), "value_json['%s']['%s']", EMSdevice::tag_to_mqtt(tag), entity); snprintf(val_cond, sizeof(val_cond), "value_json.%s is defined and %s is defined", EMSdevice::tag_to_mqtt(tag), val_obj); } else { snprintf(val_obj, sizeof(val_obj), "value_json['%s']", entity); @@ -1255,6 +1255,8 @@ void Mqtt::add_ha_uom(JsonObject doc, const uint8_t type, const uint8_t uom, con } bool Mqtt::publish_ha_climate_config(const int8_t tag, const bool has_roomtemp, const bool remove, const int16_t min, const uint32_t max) { + // TODO: check if Domoticz supports climate via MQTT discovery, otherwise exit this function if (discovery_type() != discoveryType::HOMEASSISTANT + uint8_t hc_num = tag; char topic[Mqtt::MQTT_TOPIC_MAX_SIZE];