Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gysmo38 committed Dec 11, 2022
2 parents 48fce1a + b95ad0a commit f000d6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ For nodered fans MQTT topic use cases
***
If you like my work and use it ;)<br>

<a href="https://www.buymeacoffee.com/gysmo"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=gysmo&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a>
<a href='https://ko-fi.com/L3L0GSF7X' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi2.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
8 changes: 4 additions & 4 deletions src/mitsubishi2mqtt/mitsubishi2mqtt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1531,10 +1531,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 > ");
Expand Down

0 comments on commit f000d6e

Please sign in to comment.