From a88f9070b97a794e5d48253b5df352ef2db47aad Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 31 Oct 2024 22:27:25 +0100 Subject: [PATCH 1/4] package update --- interface/package.json | 2 +- interface/yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/package.json b/interface/package.json index 86ab9df9d..1a5ff4c9f 100644 --- a/interface/package.json +++ b/interface/package.json @@ -47,7 +47,7 @@ "@preact/preset-vite": "^2.9.1", "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/formidable": "^3", - "@types/node": "^22.8.5", + "@types/node": "^22.8.6", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@types/react-router-dom": "^5.3.3", diff --git a/interface/yarn.lock b/interface/yarn.lock index 226e8c8ee..6d6290e4b 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1435,12 +1435,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^22.8.5": - version: 22.8.5 - resolution: "@types/node@npm:22.8.5" +"@types/node@npm:^22.8.6": + version: 22.8.6 + resolution: "@types/node@npm:22.8.6" dependencies: undici-types: "npm:~6.19.8" - checksum: 10c0/5e43553026c83f18bfa381d35c8fd608e69d12d0f0fe4601e8bb98b651a3b240be9d66c1f2f4decdbebb41d55b18e89238b02f3992d820d89801b9b3625ba8ab + checksum: 10c0/d3a11f2549234a91a4c5d0ff35ab4bdcb7ba34db4d3f1d189be39b8bd41c19aac98d117150a95a9c5a9d45b1014135477ea240b2b8317c86ae3d3cf1c3b3f8f4 languageName: node linkType: hard @@ -1657,7 +1657,7 @@ __metadata: "@table-library/react-table-library": "npm:4.1.7" "@trivago/prettier-plugin-sort-imports": "npm:^4.3.0" "@types/formidable": "npm:^3" - "@types/node": "npm:^22.8.5" + "@types/node": "npm:^22.8.6" "@types/react": "npm:^18.3.12" "@types/react-dom": "npm:^18.3.1" "@types/react-router-dom": "npm:^5.3.3" From d6e66982fdc0556574eb1bbcbae5e4226c4bbe4e Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 31 Oct 2024 22:27:57 +0100 Subject: [PATCH 2/4] 3.7.1-dev-2 --- CHANGELOG_LATEST.md | 8 ++++++-- src/version.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 3ec0c30e6..235d65aeb 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -4,14 +4,18 @@ For more details go to [www.emsesp.org](https://www.emsesp.org/). ## [3.7.1] -## **IMPORTANT! BREAKING CHANGES with 3.7.0** +## **IMPORTANT! BREAKING CHANGES since v3.7.0** ## Added -- Include HA "unit_of_meas", "stat_cla" and "dev_cla" attributes for Number sensors [#2149](https://github.com/emsesp/EMS-ESP32/issues/2149) +- include HA "unit_of_meas", "stat_cla" and "dev_cla" attributes for Number sensors [#2149](https://github.com/emsesp/EMS-ESP32/issues/2149) +- Bosch CS6800i AW - Silent Mode + Electrical Power Reduction (HP) [#2147](https://github.com/emsesp/EMS-ESP32/issues/2147) ## Fixed - Modbus integration in 3.7.0 missing offset [#2148](https://github.com/emsesp/EMS-ESP32/issues/2148) +- fix changing TZ in NTPsettings without clearing enable+server, added DST support [#2142](https://github.com/emsesp/EMS-ESP32/issues/2142) ## Changed + +- MQTT discovery template to support Domoticz [#2138](https://github.com/emsesp/EMS-ESP32/discussions/2138) diff --git a/src/version.h b/src/version.h index a00805685..44685a7fa 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.1-dev.1" \ No newline at end of file +#define EMSESP_APP_VERSION "3.7.1-dev.2" \ No newline at end of file From 2def5a237a544d9de830e555931716881141a733 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 31 Oct 2024 22:28:27 +0100 Subject: [PATCH 3/4] added a comment --- src/emsdevice.cpp | 68 ++++++++++------------------------------------- 1 file changed, 14 insertions(+), 54 deletions(-) diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index f87a3ec23..9f9bc28b9 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -136,26 +136,10 @@ const char * EMSdevice::device_type_2_device_name(const uint8_t device_type) { return F_(gateway); case DeviceType::SWITCH: return F_(switch); - case DeviceType::CONTROLLER: - return F_(controller); - case DeviceType::CONNECT: - return F_(connect); - case DeviceType::ALERT: - return F_(alert); - case DeviceType::EXTENSION: - return F_(extension); - case DeviceType::GENERIC: - return F_(generic); - case DeviceType::HEATSOURCE: - return F_(heatsource); - case DeviceType::VENTILATION: - return F_(ventilation); - case DeviceType::WATER: - return F_(water); - case DeviceType::POOL: - return F_(pool); - default: - return Helpers::translated_word(FL_(unknown), true); + case DeviceType::CONTROLLER : return F_(controller); case DeviceType::CONNECT : return F_(connect); case DeviceType::ALERT : return F_(alert); + case DeviceType::EXTENSION : return F_(extension); case DeviceType::GENERIC : return F_(generic); + case DeviceType::HEATSOURCE : return F_(heatsource); case DeviceType::VENTILATION : return F_(ventilation); + case DeviceType::WATER : return F_(water); case DeviceType::POOL : return F_(pool); default : return Helpers::translated_word(FL_(unknown), true); } } @@ -234,46 +218,22 @@ uint8_t EMSdevice::device_name_2_device_type(const char * topic) { return DeviceType::MIXER; } if (!strcmp(lowtopic, F_(switch))) { - return DeviceType::SWITCH; - } - if (!strcmp(lowtopic, F_(gateway))) { - return DeviceType::GATEWAY; - } - if (!strcmp(lowtopic, F_(alert))) { + return DeviceType::SWITCH; + } + if (!strcmp(lowtopic, F_(gateway))) { return DeviceType::GATEWAY; } if (!strcmp(lowtopic, F_(alert))) { return DeviceType::ALERT; - } - if (!strcmp(lowtopic, F_(extension))) { - return DeviceType::EXTENSION; - } - if (!strcmp(lowtopic, F_(heatsource))) { + } if (!strcmp(lowtopic, F_(extension))) { return DeviceType::EXTENSION; } if (!strcmp(lowtopic, F_(heatsource))) { return DeviceType::HEATSOURCE; - } - if (!strcmp(lowtopic, F_(ventilation))) { - return DeviceType::VENTILATION; - } - if (!strcmp(lowtopic, F_(water))) { + } if (!strcmp(lowtopic, F_(ventilation))) { return DeviceType::VENTILATION; } if (!strcmp(lowtopic, F_(water))) { return DeviceType::WATER; - } - if (!strcmp(lowtopic, F_(pool))) { - return DeviceType::POOL; - } + } if (!strcmp(lowtopic, F_(pool))) { return DeviceType::POOL; } // non EMS - if (!strcmp(lowtopic, F_(custom))) { - return DeviceType::CUSTOM; - } - if (!strcmp(lowtopic, F_(temperaturesensor))) { + if (!strcmp(lowtopic, F_(custom))) { return DeviceType::CUSTOM; } if (!strcmp(lowtopic, F_(temperaturesensor))) { return DeviceType::TEMPERATURESENSOR; - } - if (!strcmp(lowtopic, F_(analogsensor))) { - return DeviceType::ANALOGSENSOR; - } - if (!strcmp(lowtopic, F_(scheduler))) { + } if (!strcmp(lowtopic, F_(analogsensor))) { return DeviceType::ANALOGSENSOR; } if (!strcmp(lowtopic, F_(scheduler))) { return DeviceType::SCHEDULER; - } - if (!strcmp(lowtopic, F_(system))) { - return DeviceType::SYSTEM; - } + } if (!strcmp(lowtopic, F_(system))) { return DeviceType::SYSTEM; } return DeviceType::UNKNOWN; } @@ -1845,9 +1805,9 @@ void EMSdevice::mqtt_ha_entity_config_create() { uint16_t count = 0; // check the state of each of the device values - // create climate if roomtemp is visible // create the discovery topic if if hasn't already been created, not a command (like reset) and is active and visible for (auto & dv : devicevalues_) { + // create climate when we reach the haclimate entity if (!strcmp(dv.short_name, FL_(haclimate)[0]) && !dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE) && dv.has_state(DeviceValueState::DV_ACTIVE)) { if (*(int8_t *)(dv.value_p) == 1 && (!dv.has_state(DeviceValueState::DV_HA_CONFIG_CREATED) || dv.has_state(DeviceValueState::DV_HA_CLIMATE_NO_RT))) { if (Mqtt::publish_ha_climate_config(dv.tag, true, false, dv.min, dv.max)) { // roomTemp From 628f845b166e57e18a70e6e8b2abe682c6683ca4 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 31 Oct 2024 22:28:53 +0100 Subject: [PATCH 4/4] 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];