From fe183225686c194456eed2f4001ba088a7c1f445 Mon Sep 17 00:00:00 2001 From: Gysmo Date: Sat, 3 Dec 2022 14:11:10 +0100 Subject: [PATCH 1/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b5fa3b..49e4169 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,4 @@ For nodered fans MQTT topic use cases *** If you like my work and use it ;)
- + From 4a3adb257103889bd05d305160c3e7f6faaa44fa Mon Sep 17 00:00:00 2001 From: Gysmo Date: Sat, 3 Dec 2022 14:11:50 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49e4169..1cb5992 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,4 @@ For nodered fans MQTT topic use cases *** If you like my work and use it ;)
- +Buy Me a Coffee at ko-fi.com From 47684d022586b8f869ba5f89027f31ed87e43c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Jonas=20S=C3=A4mann?= Date: Mon, 5 Dec 2022 00:12:20 +0100 Subject: [PATCH 3/4] Revert "Update HASS temp_stat_tpl min-max enforcement" This reverts commit 924d25fa8766254c31bdeaf330a039f150f0ce11. Because did not work as expected either --- src/mitsubishi2mqtt/mitsubishi2mqtt.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mitsubishi2mqtt/mitsubishi2mqtt.ino b/src/mitsubishi2mqtt/mitsubishi2mqtt.ino index 0ec1df6..6fcd9a9 100644 --- a/src/mitsubishi2mqtt/mitsubishi2mqtt.ino +++ b/src/mitsubishi2mqtt/mitsubishi2mqtt.ino @@ -1504,10 +1504,10 @@ void haConfig() { haConfig["pl_not_avail"] = mqtt_payload_unavailable; // MQTT offline message payload haConfig["pl_avail"] = mqtt_payload_available; // MQTT online message payload //Set default value for fix "Could not parse data for HA" - String temp_stat_tpl_str = F("{% if (value_json is defined and value_json.temperature is defined) %}{{ value_json.temperature|float"); - temp_stat_tpl_str +="|min(" + (String)convertCelsiusToLocalUnit(min_temp, useFahrenheit) + ")"; - temp_stat_tpl_str +="|max(" + (String)convertCelsiusToLocalUnit(max_temp, useFahrenheit) + ")"; - temp_stat_tpl_str +=" }}{% else %}" + (String)convertCelsiusToLocalUnit(22, useFahrenheit) + "{% endif %}"; + String temp_stat_tpl_str = F("{% if (value_json is defined and value_json.temperature is defined) %}{% if (value_json.temperature|int > "); + temp_stat_tpl_str +=(String)convertCelsiusToLocalUnit(min_temp, useFahrenheit) + " and value_json.temperature|int < "; + temp_stat_tpl_str +=(String)convertCelsiusToLocalUnit(max_temp, useFahrenheit) + ") %}{{ value_json.temperature }}"; + temp_stat_tpl_str +="{% elif (value_json.temperature|int < " + (String)convertCelsiusToLocalUnit(min_temp, useFahrenheit) + ") %}" + (String)convertCelsiusToLocalUnit(min_temp, useFahrenheit) + "{% elif (value_json.temperature|int > " + (String)convertCelsiusToLocalUnit(max_temp, useFahrenheit) + ") %}" + (String)convertCelsiusToLocalUnit(max_temp, useFahrenheit) + "{% endif %}{% else %}" + (String)convertCelsiusToLocalUnit(22, useFahrenheit) + "{% endif %}"; haConfig["temp_stat_tpl"] = temp_stat_tpl_str; haConfig["curr_temp_t"] = ha_state_topic; String curr_temp_tpl_str = F("{{ value_json.roomTemperature if (value_json is defined and value_json.roomTemperature is defined and value_json.roomTemperature|int > "); From 6bdf53af41b3813a5bc9eb1dbd6b0be08c721af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Jonas=20S=C3=A4mann?= Date: Mon, 5 Dec 2022 00:22:47 +0100 Subject: [PATCH 4/4] Update HASS jinja template min/max logik Allow exact values of min/max to be displayed --- src/mitsubishi2mqtt/mitsubishi2mqtt.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mitsubishi2mqtt/mitsubishi2mqtt.ino b/src/mitsubishi2mqtt/mitsubishi2mqtt.ino index 6fcd9a9..5f906a8 100644 --- a/src/mitsubishi2mqtt/mitsubishi2mqtt.ino +++ b/src/mitsubishi2mqtt/mitsubishi2mqtt.ino @@ -1504,8 +1504,8 @@ void haConfig() { haConfig["pl_not_avail"] = mqtt_payload_unavailable; // MQTT offline message payload haConfig["pl_avail"] = mqtt_payload_available; // MQTT online message payload //Set default value for fix "Could not parse data for HA" - String temp_stat_tpl_str = F("{% if (value_json is defined and value_json.temperature is defined) %}{% if (value_json.temperature|int > "); - temp_stat_tpl_str +=(String)convertCelsiusToLocalUnit(min_temp, useFahrenheit) + " and value_json.temperature|int < "; + String temp_stat_tpl_str = F("{% if (value_json is defined and value_json.temperature is defined) %}{% if (value_json.temperature|int >= "); + temp_stat_tpl_str +=(String)convertCelsiusToLocalUnit(min_temp, useFahrenheit) + " and value_json.temperature|int <= "; temp_stat_tpl_str +=(String)convertCelsiusToLocalUnit(max_temp, useFahrenheit) + ") %}{{ value_json.temperature }}"; temp_stat_tpl_str +="{% elif (value_json.temperature|int < " + (String)convertCelsiusToLocalUnit(min_temp, useFahrenheit) + ") %}" + (String)convertCelsiusToLocalUnit(min_temp, useFahrenheit) + "{% elif (value_json.temperature|int > " + (String)convertCelsiusToLocalUnit(max_temp, useFahrenheit) + ") %}" + (String)convertCelsiusToLocalUnit(max_temp, useFahrenheit) + "{% endif %}{% else %}" + (String)convertCelsiusToLocalUnit(22, useFahrenheit) + "{% endif %}"; haConfig["temp_stat_tpl"] = temp_stat_tpl_str;