Skip to content

Commit

Permalink
Merge pull request #31 from wouzzie/master
Browse files Browse the repository at this point in the history
Switch to percentages for HA Discovery support
  • Loading branch information
arjenhiemstra authored Sep 2, 2021
2 parents e3e6ab8 + 671d3c5 commit 5a43b9d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions software/NRG_itho_wifi/09_init_code.ino
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,10 @@ void HADiscoveryFan() {
root["json_attr_t"] = (const char*)systemConfig.mqtt_sensor_topic;
sprintf(s, "%s/not_used/but_needed_for_HA", systemConfig.mqtt_cmd_topic);
root["cmd_t"] = s;
root["spd_cmd_t"] = (const char*)systemConfig.mqtt_cmd_topic;
root["spd_stat_t"] = (const char*)systemConfig.mqtt_state_topic;
root["payload_high_speed"] = systemConfig.itho_high;
root["payload_medium_speed"] = systemConfig.itho_medium;
root["payload_low_speed"] = systemConfig.itho_low;
root["pct_cmd_t"] = (const char*)systemConfig.mqtt_cmd_topic;
root["pct_cmd_tpl"] = "{{ value * 2.54 }}";
root["pct_stat_t"] = (const char*)systemConfig.mqtt_state_topic;
root["pct_val_tpl"] = "{{ ((value | int) / 2.54) | round}}";

sprintf(s, "%s/fan/%s/config" , (const char*)systemConfig.mqtt_ha_topic, hostName());

Expand Down

0 comments on commit 5a43b9d

Please sign in to comment.