mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
Fix HomeAssisant Thermostat integration
Things like translations work proper with the auto/manual/off messages. Also it allows for working buttons in HA.
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: Thermostat
|
name: Thermostat
|
||||||
modes:
|
modes:
|
||||||
- low
|
- "auto"
|
||||||
- manual
|
- "manual"
|
||||||
- auto
|
- "off"
|
||||||
|
|
||||||
mode_state_topic: "home/ems-esp/thermostat_data"
|
mode_state_topic: "home/ems-esp/thermostat_data"
|
||||||
current_temperature_topic: "home/ems-esp/thermostat_data"
|
current_temperature_topic: "home/ems-esp/thermostat_data"
|
||||||
|
|||||||
@@ -1233,9 +1233,9 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
myDebug("MQTT topic: thermostat mode value %s", message);
|
myDebug("MQTT topic: thermostat mode value %s", message);
|
||||||
if (strcmp((char *)message, "auto") == 0) {
|
if (strcmp((char *)message, "auto") == 0) {
|
||||||
ems_setThermostatMode(2);
|
ems_setThermostatMode(2);
|
||||||
} else if (strcmp((char *)message, "day") == 0) {
|
} else if (strcmp((char *)message, "day") == 0 || strcmp((char *)message, "manual") == 0) {
|
||||||
ems_setThermostatMode(1);
|
ems_setThermostatMode(1);
|
||||||
} else if (strcmp((char *)message, "night") == 0) {
|
} else if (strcmp((char *)message, "night") == 0 || strcmp((char *)message, "off") == 0) {
|
||||||
ems_setThermostatMode(0);
|
ems_setThermostatMode(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user