Skip to content

Commit

Permalink
Re-adding imperial-friendly HA config templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
shampeon committed Jan 20, 2020
1 parent 3111cff commit 3b8fb7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mitsubishi2mqtt/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
*/

String m2mqtt_version = "0.4.7.1";
String m2mqtt_version = "0.4.7.2";

//Define global variables for files
String wifi_conf = "wifi.json";
Expand Down
4 changes: 2 additions & 2 deletions src/mitsubishi2mqtt/mitsubishi2mqtt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,9 @@ void haConfig() {
haConfig["mode_stat_tpl"] = "{{ value_json.mode if (value_json is defined and value_json.mode is defined and value_json.mode|length) else 'off' }}"; //Set default value for fix "Could not parse data for HA"
haConfig["temp_cmd_t"] = ha_temp_set_topic;
haConfig["temp_stat_t"] = ha_state_topic;
haConfig["temp_stat_tpl"] = "{{ value_json.temperature if (value_json is defined and value_json.temperature is defined and value_json.temperature|int > 16) else '26' }}"; //Set default value for fix "Could not parse data for HA"
haConfig["temp_stat_tpl"] = "{{ value_json.temperature if (value_json is defined and value_json.temperature is defined and value_json.temperature|int > " + (String)getTemperature(16, useFahrenheit) + ") else '" + (String)getTemperature(26, useFahrenheit) + "' }}"; //Set default value for fix "Could not parse data for HA"
haConfig["curr_temp_t"] = ha_state_topic;
haConfig["curr_temp_tpl"] = "{{ value_json.roomTemperature if (value_json is defined and value_json.roomTemperature is defined and value_json.roomTemperature|int > 16) else '26' }}"; //Set default value for fix "Could not parse data for HA"
haConfig["curr_temp_tpl"] = "{{ value_json.roomTemperature if (value_json is defined and value_json.roomTemperature is defined and value_json.roomTemperature|int > " + (String)getTemperature(8, useFahrenheit) + ") else '" + (String)getTemperature(26, useFahrenheit) + "' }}"; //Set default value for fix "Could not parse data for HA"
haConfig["min_temp"] = min_temp;
haConfig["max_temp"] = max_temp;
haConfig["temp_step"] = temp_step;
Expand Down

2 comments on commit 3b8fb7a

@jascdk
Copy link
Contributor

@jascdk jascdk commented on 3b8fb7a Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shampeon hi :) does this fix change the issue that the temperature always bounces up to 26 degrees ? I have struggled with this issue for quite some while now - it has been very frustrating 🤓

@shampeon
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This checks to see if the current temperature is greater than 8 degrees C (or 46 degrees F if you've set the code to use Fahrenheit values in config.h). I lowered the Celsius value to 8 because I have a side-building with a heatpump that gets colder than 16 C/60 F, and I was seeing what you were seeing: the current temperature was reading 26 C/79 F, which wasn't accurate at all.

I do feel like this template could be further refined to not throw the HA parse error but still indicate the temperature hasn't been read yet. Putting in default values for the heatpump temp setting is fine, but not for thermometer readings.

Please sign in to comment.