From 490b004ebb03dab262bf055425c412e3b2d575a4 Mon Sep 17 00:00:00 2001 From: logon84 Date: Sat, 4 Dec 2021 02:33:07 +0100 Subject: [PATCH 01/11] Update xdrv_44_miel_hvac.ino --- tasmota/xdrv_44_miel_hvac.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index dd7461d8c..1a97425b8 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -904,7 +904,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings")); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), MQTT_INFO_RETAIN); } static void From 2437ab117f2af6b5af0bf2dfaffa7154d5bc7f0b Mon Sep 17 00:00:00 2001 From: logon84 Date: Sat, 4 Dec 2021 11:18:13 +0100 Subject: [PATCH 02/11] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 1a97425b8..1c9c97a79 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -904,7 +904,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), MQTT_INFO_RETAIN); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), Settings->flag5.mqtt_info_retain); } static void @@ -945,7 +945,7 @@ miel_hvac_data_response(struct miel_hvac_softc *sc, Response_P(PSTR("{\"Bytes\":\"%s\"}"), ToHex_P((uint8_t *)d, sizeof(*d), hex, sizeof(hex))); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData")); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData"),Settings->flag5.mqtt_info_retain); } static void From 4704829412af53dea5412e2a4e9fccf68ee0d667 Mon Sep 17 00:00:00 2001 From: logon84 Date: Sun, 5 Dec 2021 23:59:04 +0100 Subject: [PATCH 03/11] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 47 +++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 1c9c97a79..e6d8ab667 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -68,11 +68,14 @@ struct miel_hvac_data_settings { uint8_t widevane; #define MIEL_HVAC_SETTTINGS_WIDEVANE_MASK \ 0x0f + uint8_t temp05; }; struct miel_hvac_data_roomtemp { uint8_t _pad1[2]; uint8_t temp; + uint8_t _pad1[2]; + uint8_t temp05; }; struct miel_hvac_data_status { @@ -109,8 +112,10 @@ CTASSERT(offsetof(struct miel_hvac_data, data.settings.temp) == 5); CTASSERT(offsetof(struct miel_hvac_data, data.settings.fan) == 6); CTASSERT(offsetof(struct miel_hvac_data, data.settings.vane) == 7); CTASSERT(offsetof(struct miel_hvac_data, data.settings.widevane) == 10); +CTASSERT(offsetof(struct miel_hvac_data, data.settings.temp05) == 11); CTASSERT(offsetof(struct miel_hvac_data, data.roomtemp.temp) == 3); +CTASSERT(offsetof(struct miel_hvac_data, data.roomtemp.temp05) == 6); /* to hvac */ @@ -140,6 +145,7 @@ struct miel_hvac_msg_update { #define MIEL_HVAC_UPDATE_F_TEMP (1 << 10) #define MIEL_HVAC_UPDATE_F_FAN (1 << 11) #define MIEL_HVAC_UPDATE_F_VANE (1 << 12) +#define MIEL_HVAC_UPDATE_F_TEMP05 (1 << 19) uint8_t power; #define MIEL_HVAC_UPDATE_POWER_OFF 0x00 #define MIEL_HVAC_UPDATE_POWER_ON 0x01 @@ -180,7 +186,8 @@ struct miel_hvac_msg_update { #define MIEL_HVAC_UPDATE_WIDEVANE_LR 0x08 #define MIEL_HVAC_UPDATE_WIDEVANE_SWING 0x0c #define MIEL_HVAC_UPDATE_WIDEVANE_ADJ 0x80 - uint8_t _pad2[2]; + uint8_t temp05; + uint8_t _pad2[1]; } __packed; CTASSERT(sizeof(struct miel_hvac_msg_update) == 16); @@ -192,11 +199,16 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, temp) == MIEL_HVAC_OFFS(10)); CTASSERT(offsetof(struct miel_hvac_msg_update, fan) == MIEL_HVAC_OFFS(11)); CTASSERT(offsetof(struct miel_hvac_msg_update, vane) == MIEL_HVAC_OFFS(12)); CTASSERT(offsetof(struct miel_hvac_msg_update, widevane) == MIEL_HVAC_OFFS(18)); +CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); static inline uint8_t miel_hvac_deg2temp(uint8_t deg) { - return (31 - deg); +#ifndef MIEL_HVAC_ENHANCED_RES +return (31 - deg); +#else +return 2*deg + 128; +#endif } static inline uint8_t @@ -686,16 +698,20 @@ miel_hvac_cmnd_settemp(void) if (XdrvMailbox.data_len == 0) return; - + degc = strtoul(XdrvMailbox.data, nullptr, 0); if (degc < MIEL_HVAC_UPDATE_TEMP_MIN || degc > MIEL_HVAC_UPDATE_TEMP_MAX) { miel_hvac_respond_unsupported(); return; } - - update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); - update->temp = miel_hvac_deg2temp(degc); + #ifndef MIEL_HVAC_ENHANCED_RES + update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); + update->temp = miel_hvac_deg2temp(degc); + #else + update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP05); + update->temp05 = miel_hvac_deg2temp(degc); + #endif ResponseCmndNumber(degc); } @@ -871,9 +887,15 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR(",\"HA" D_JSON_IRHVAC_MODE "\":\"%s\""), set->power ? name : "off"); } - - dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp)), - Settings->flag2.temperature_resolution, temp); + if (set->temp05 == 0) { + dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp)), + Settings->flag2.temperature_resolution, temp); + } + else { + #define MIEL_HVAC_ENHANCED_RES 1 + dtostrfd(ConvertTemp((float)(((set->temp05 - 128))/2)), + Settings->flag2.temperature_resolution, temp); + } ResponseAppend_P(PSTR(",\"" D_JSON_IRHVAC_TEMP "\":%s"), temp); name = miel_hvac_map_byval(set->fan, @@ -1074,7 +1096,12 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) if (sc->sc_temp.type != 0) { const struct miel_hvac_data_roomtemp *rt = &sc->sc_temp.data.roomtemp; - unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); + if(rt->temp05 == 0) { + unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); + } + else { + unsigned float temp = (miel_hvac_roomtemp2deg(rt->temp05) - 128)/2; + } char room_temp[33]; dtostrfd(ConvertTemp(temp), From 1bfcdea9be5bf7aba55d5d5bde9d1248e123b1c4 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 00:29:05 +0100 Subject: [PATCH 04/11] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index e6d8ab667..381123963 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -74,7 +74,7 @@ struct miel_hvac_data_settings { struct miel_hvac_data_roomtemp { uint8_t _pad1[2]; uint8_t temp; - uint8_t _pad1[2]; + uint8_t _pad2[2]; uint8_t temp05; }; @@ -1096,16 +1096,17 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) if (sc->sc_temp.type != 0) { const struct miel_hvac_data_roomtemp *rt = &sc->sc_temp.data.roomtemp; + char room_temp[33]; if(rt->temp05 == 0) { unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); + dtostrfd(ConvertTemp(temp), + Settings->flag2.temperature_resolution, room_temp); } else { - unsigned float temp = (miel_hvac_roomtemp2deg(rt->temp05) - 128)/2; + float temp = (rt->temp05 - 128)/2; + dtostrfd(ConvertTemp(temp), + Settings->flag2.temperature_resolution, room_temp); } - char room_temp[33]; - - dtostrfd(ConvertTemp(temp), - Settings->flag2.temperature_resolution, room_temp); ResponseAppend_P(PSTR("\"" D_JSON_TEMPERATURE "\":%s"), room_temp); From 3f1e5746a1721830e1d916b8c24e147b3f97e61a Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 03:10:30 +0100 Subject: [PATCH 05/11] Update xdrv_44_miel_hvac.ino --- tasmota/xdrv_44_miel_hvac.ino | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 381123963..819e65529 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -204,23 +204,31 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); static inline uint8_t miel_hvac_deg2temp(uint8_t deg) { -#ifndef MIEL_HVAC_ENHANCED_RES -return (31 - deg); -#else -return 2*deg + 128; -#endif + #ifndef MIEL_HVAC_ENHANCED_RES + return (31 - deg); + #else + return 2*deg + 128; + #endif } static inline uint8_t miel_hvac_temp2deg(uint8_t temp) { + #ifndef MIEL_HVAC_ENHANCED_RES return (31 - temp); + #else + return ((float)(((temp - 128))/2)); + #endif } static inline unsigned int miel_hvac_roomtemp2deg(uint8_t roomtemp) { + #ifndef MIEL_HVAC_ENHANCED_RES return ((unsigned int)roomtemp + 10); + #else + return ((float)(roomtemp - 128)/2;) + #endif } struct miel_hvac_msg_remotetemp { @@ -893,7 +901,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) } else { #define MIEL_HVAC_ENHANCED_RES 1 - dtostrfd(ConvertTemp((float)(((set->temp05 - 128))/2)), + dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp05)), Settings->flag2.temperature_resolution, temp); } ResponseAppend_P(PSTR(",\"" D_JSON_IRHVAC_TEMP "\":%s"), temp); @@ -1103,7 +1111,8 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) Settings->flag2.temperature_resolution, room_temp); } else { - float temp = (rt->temp05 - 128)/2; + #define MIEL_HVAC_ENHANCED_RES 1 + float temp = miel_hvac_roomtemp2deg(rt->temp05); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); } From 90add2b4c2c757ff61deb6cc76e05f2f1a24ee5e Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 13:50:47 +0100 Subject: [PATCH 06/11] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 53 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 819e65529..981cb8643 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -145,7 +145,6 @@ struct miel_hvac_msg_update { #define MIEL_HVAC_UPDATE_F_TEMP (1 << 10) #define MIEL_HVAC_UPDATE_F_FAN (1 << 11) #define MIEL_HVAC_UPDATE_F_VANE (1 << 12) -#define MIEL_HVAC_UPDATE_F_TEMP05 (1 << 19) uint8_t power; #define MIEL_HVAC_UPDATE_POWER_OFF 0x00 #define MIEL_HVAC_UPDATE_POWER_ON 0x01 @@ -204,31 +203,34 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); static inline uint8_t miel_hvac_deg2temp(uint8_t deg) { - #ifndef MIEL_HVAC_ENHANCED_RES - return (31 - deg); - #else - return 2*deg + 128; - #endif + if (!Settings->flag5.mqtt_info_retain) { + return (31 - deg); + } + else { + return 2*deg + 128; + } } static inline uint8_t miel_hvac_temp2deg(uint8_t temp) { - #ifndef MIEL_HVAC_ENHANCED_RES - return (31 - temp); - #else - return ((float)(((temp - 128))/2)); - #endif + if (!Settings->flag5.mqtt_info_retain) { + return (31 - temp); + } + else { + return ((float)(((temp - 128))/2)); + } } static inline unsigned int miel_hvac_roomtemp2deg(uint8_t roomtemp) { - #ifndef MIEL_HVAC_ENHANCED_RES - return ((unsigned int)roomtemp + 10); - #else - return ((float)(roomtemp - 128)/2;) - #endif + if (!Settings->flag5.mqtt_info_retain) { + return ((unsigned int)roomtemp + 10); + } + else { + return ((float)((roomtemp - 128)/2)); + } } struct miel_hvac_msg_remotetemp { @@ -713,13 +715,16 @@ miel_hvac_cmnd_settemp(void) miel_hvac_respond_unsupported(); return; } - #ifndef MIEL_HVAC_ENHANCED_RES - update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); + update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); + if (!Settings->flag5.mqtt_info_retain) { update->temp = miel_hvac_deg2temp(degc); - #else - update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP05); + update->temp05 = 0; + } + + else { + update->temp = 0; update->temp05 = miel_hvac_deg2temp(degc); - #endif + } ResponseCmndNumber(degc); } @@ -895,12 +900,11 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR(",\"HA" D_JSON_IRHVAC_MODE "\":\"%s\""), set->power ? name : "off"); } - if (set->temp05 == 0) { + if (!Settings->flag5.mqtt_info_retain) { dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp)), Settings->flag2.temperature_resolution, temp); } else { - #define MIEL_HVAC_ENHANCED_RES 1 dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp05)), Settings->flag2.temperature_resolution, temp); } @@ -1105,13 +1109,12 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) const struct miel_hvac_data_roomtemp *rt = &sc->sc_temp.data.roomtemp; char room_temp[33]; - if(rt->temp05 == 0) { + if(!Settings->flag5.mqtt_info_retain) { unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); } else { - #define MIEL_HVAC_ENHANCED_RES 1 float temp = miel_hvac_roomtemp2deg(rt->temp05); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); From a55cc22cd70ada5dafbbbb8234499b90b5c826bf Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 13:53:42 +0100 Subject: [PATCH 07/11] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 981cb8643..4c28364e6 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -207,7 +207,7 @@ miel_hvac_deg2temp(uint8_t deg) return (31 - deg); } else { - return 2*deg + 128; + return (2*deg + 128); } } From 9237b4f449f4560545819a379e79c88960feac78 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 18:59:10 +0100 Subject: [PATCH 08/11] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 4c28364e6..896e2da08 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -42,6 +42,8 @@ #include /* from hvac */ +bool temp_type = false; + struct miel_hvac_header { uint8_t start; #define MIEL_HVAC_H_START 0xfc @@ -200,36 +202,39 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, vane) == MIEL_HVAC_OFFS(12)); CTASSERT(offsetof(struct miel_hvac_msg_update, widevane) == MIEL_HVAC_OFFS(18)); CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); -static inline uint8_t -miel_hvac_deg2temp(uint8_t deg) +static inline float +miel_hvac_deg2temp(float deg) { - if (!Settings->flag5.mqtt_info_retain) { + if (!temp_type) { return (31 - deg); } else { - return (2*deg + 128); + deg += 128; + return ((float) 2*deg); } } -static inline uint8_t +static inline float miel_hvac_temp2deg(uint8_t temp) { - if (!Settings->flag5.mqtt_info_retain) { + if (!temp_type) { return (31 - temp); } else { - return ((float)(((temp - 128))/2)); + temp -= 128; + return ((float) temp/2); } } -static inline unsigned int +static inline float miel_hvac_roomtemp2deg(uint8_t roomtemp) { - if (!Settings->flag5.mqtt_info_retain) { + if (!temp_type) { return ((unsigned int)roomtemp + 10); } else { - return ((float)((roomtemp - 128)/2)); + roomtemp -= 128; + return ((float) roomtemp/2); } } @@ -704,7 +709,7 @@ miel_hvac_cmnd_settemp(void) { struct miel_hvac_softc *sc = miel_hvac_sc; struct miel_hvac_msg_update *update = &sc->sc_update; - unsigned long degc; + float degc; if (XdrvMailbox.data_len == 0) return; @@ -716,7 +721,7 @@ miel_hvac_cmnd_settemp(void) return; } update->flags |= htons(MIEL_HVAC_UPDATE_F_TEMP); - if (!Settings->flag5.mqtt_info_retain) { + if (!temp_type) { update->temp = miel_hvac_deg2temp(degc); update->temp05 = 0; } @@ -900,11 +905,12 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR(",\"HA" D_JSON_IRHVAC_MODE "\":\"%s\""), set->power ? name : "off"); } - if (!Settings->flag5.mqtt_info_retain) { + if (set->temp05 == 0) { dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp)), Settings->flag2.temperature_resolution, temp); } else { + temp_type = true; dtostrfd(ConvertTemp(miel_hvac_temp2deg(set->temp05)), Settings->flag2.temperature_resolution, temp); } @@ -1109,12 +1115,13 @@ miel_hvac_sensor(struct miel_hvac_softc *sc) const struct miel_hvac_data_roomtemp *rt = &sc->sc_temp.data.roomtemp; char room_temp[33]; - if(!Settings->flag5.mqtt_info_retain) { + if(rt->temp05 == 0) { unsigned int temp = miel_hvac_roomtemp2deg(rt->temp); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); } else { + temp_type = true; float temp = miel_hvac_roomtemp2deg(rt->temp05); dtostrfd(ConvertTemp(temp), Settings->flag2.temperature_resolution, room_temp); From 8efb7d005c83898d567ff0c32301140b7d563504 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 19:01:26 +0100 Subject: [PATCH 09/11] Update xdrv_44_miel_hvac.ino --- tasmota/xdrv_44_miel_hvac.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 896e2da08..7856db243 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -944,7 +944,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), Settings->flag5.mqtt_info_retain); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings")); } static void @@ -985,7 +985,7 @@ miel_hvac_data_response(struct miel_hvac_softc *sc, Response_P(PSTR("{\"Bytes\":\"%s\"}"), ToHex_P((uint8_t *)d, sizeof(*d), hex, sizeof(hex))); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData"),Settings->flag5.mqtt_info_retain); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData")); } static void From 038970c82690601d9dc4866ac32b1a21cacfb4f3 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 19:35:13 +0100 Subject: [PATCH 10/11] Add files via upload --- tasmota/xdrv_44_miel_hvac.ino | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index 7856db243..bd0a70efa 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -202,15 +202,15 @@ CTASSERT(offsetof(struct miel_hvac_msg_update, vane) == MIEL_HVAC_OFFS(12)); CTASSERT(offsetof(struct miel_hvac_msg_update, widevane) == MIEL_HVAC_OFFS(18)); CTASSERT(offsetof(struct miel_hvac_msg_update, temp05) == MIEL_HVAC_OFFS(19)); -static inline float +static inline uint8_t miel_hvac_deg2temp(float deg) { if (!temp_type) { return (31 - deg); } else { - deg += 128; - return ((float) 2*deg); + deg = 2*deg + 128; + return ((uint8_t) deg); } } @@ -714,7 +714,7 @@ miel_hvac_cmnd_settemp(void) if (XdrvMailbox.data_len == 0) return; - degc = strtoul(XdrvMailbox.data, nullptr, 0); + degc = strtof(XdrvMailbox.data, nullptr); if (degc < MIEL_HVAC_UPDATE_TEMP_MIN || degc > MIEL_HVAC_UPDATE_TEMP_MAX) { miel_hvac_respond_unsupported(); @@ -944,7 +944,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings")); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), Settings->flag5.mqtt_info_retain); } static void @@ -985,7 +985,7 @@ miel_hvac_data_response(struct miel_hvac_softc *sc, Response_P(PSTR("{\"Bytes\":\"%s\"}"), ToHex_P((uint8_t *)d, sizeof(*d), hex, sizeof(hex))); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData")); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData"),Settings->flag5.mqtt_info_retain); } static void From 2e5b7deeadd6b27ff39400e1369da4a6bc279e84 Mon Sep 17 00:00:00 2001 From: logon84 Date: Mon, 6 Dec 2021 19:36:56 +0100 Subject: [PATCH 11/11] Update xdrv_44_miel_hvac.ino --- tasmota/xdrv_44_miel_hvac.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_44_miel_hvac.ino b/tasmota/xdrv_44_miel_hvac.ino index bd0a70efa..66e034fec 100644 --- a/tasmota/xdrv_44_miel_hvac.ino +++ b/tasmota/xdrv_44_miel_hvac.ino @@ -944,7 +944,7 @@ miel_hvac_publish_settings(struct miel_hvac_softc *sc) ResponseAppend_P(PSTR("}")); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings"), Settings->flag5.mqtt_info_retain); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACSettings")); } static void @@ -985,7 +985,7 @@ miel_hvac_data_response(struct miel_hvac_softc *sc, Response_P(PSTR("{\"Bytes\":\"%s\"}"), ToHex_P((uint8_t *)d, sizeof(*d), hex, sizeof(hex))); - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData"),Settings->flag5.mqtt_info_retain); + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR("HVACData")); } static void