Skip to content

Commit ddc9ec1

Browse files
authored
Sync the on state to power from mode for HA (#1946)
Co-authored-by: Sillyfrog <[email protected]> I'm setting up the IRMQTTserver to link with HA (first time I've done it with an AC), and running with 2 outputs. I've found that the On state was doing weird things and this is the solution that worked for me (forcing the sync of the power state to On as well). Please let me know if I missed something - it's been a while since I've had a chance to work on such things :) I'm using the FUJITSU_AC protocol (not sure it matters, but this one has a completely different "Off" format vs On).
1 parent 2f7afbd commit ddc9ec1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/IRMQTTServer/IRMQTTServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const uint16_t kJsonAcStateMaxSize = 1024; // Bytes
290290
// ----------------- End of User Configuration Section -------------------------
291291

292292
// Constants
293-
#define _MY_VERSION_ "v1.7.1"
293+
#define _MY_VERSION_ "v1.7.2"
294294

295295
const uint8_t kRebootTime = 15; // Seconds
296296
const uint8_t kQuickDisplayTime = 2; // Seconds

examples/IRMQTTServer/IRMQTTServer.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3081,7 +3081,11 @@ void updateClimate(stdAc::state_t *state, const String str,
30813081
state->mode = IRac::strToOpmode(payload.c_str());
30823082
#if MQTT_CLIMATE_HA_MODE
30833083
// When in Home Assistant mode, a Mode of Off, means turn the Power off too.
3084-
if (state->mode == stdAc::opmode_t::kOff) state->power = false;
3084+
if (state->mode == stdAc::opmode_t::kOff) {
3085+
state->power = false;
3086+
} else {
3087+
state->power = true;
3088+
}
30853089
#endif // MQTT_CLIMATE_HA_MODE
30863090
} else if (str.equals(prefix + F(KEY_TEMP))) {
30873091
state->degrees = payload.toFloat();

0 commit comments

Comments
 (0)