Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix for fan not showing 4 and Auto after powerdown AC #132

Merged
merged 2 commits into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Version.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
MHI-AC-Ctrl by absalom-muc

**v2.7R1** (February 2023)
- Fix for fan not showing 4 and Auto after powerdown AC [pull request #132](https://github.com/absalom-muc/MHI-AC-Ctrl/pull/132#) according to [issue #99](https://github.com/absalom-muc/MHI-AC-Ctrl/issues/99#issuecomment-1407615341) by [glsf91](https://github.com/glsf91).

**v2.6** (January 2023)
- Fix of [Wifi reconnect takes too long #125](https://github.com/absalom-muc/MHI-AC-Ctrl/issues/125)
- Typo related to the unit of TD fixed in MHI-AC-Ctrl-core.h and SW-Configuration.md
Expand Down
6 changes: 6 additions & 0 deletions src/MHI-AC-Ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@
#define PAYLOAD_OP_DEFROST_ON "On"
#define PAYLOAD_OP_DEFROST_OFF "Off"
#define PAYLOAD_REQUEST_RESET "reset"

enum POWER_STATUS {
unknown,
off,
on
};
18 changes: 18 additions & 0 deletions src/MHI-AC-Ctrl.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

MHI_AC_Ctrl_Core mhi_ac_ctrl_core;

POWER_STATUS power_status = unknown;

unsigned long room_temp_set_timeout_Millis = millis();
bool troom_was_set_by_MQTT = false;

Expand Down Expand Up @@ -165,14 +167,30 @@ class StatusHandler : public CallbackInterface_Status {
//Serial.printf_P(PSTR("status=%i value=%i\n"), status, value);
switch (status) {
case status_power:
// After powerdown AC (230V), fan status is only showing 1, 2 or 3. 4 and Auto is not shown when changing with RC.
// Only when setting fan to Auto one time after powerdown AC, it will show 4 and Auto.
// Below will take care of this.
if (power_status == unknown) { // First time after startup esp
Serial.printf("power_status: unknown; received status_power: %i\n", value);
if (value == power_off) { // Only when status is power off, set fan to Auto.
Serial.println("Set fan to Auto to fix fan status after powerdown (230V) AC");
mhi_ac_ctrl_core. set_fan(7);
}
} else if (power_status == off)
Serial.printf("power_status: off; received status_power: %i\n", value);
else if (power_status == on)
Serial.printf("power_status: on; received status_power: %i\n", value);

if (value == power_on){
output_P(status, (TOPIC_POWER), PSTR(PAYLOAD_POWER_ON));
power_status = on;
#ifdef POWERON_WHEN_CHANGING_MODE
cbiStatusFunction(status_mode, mode_tmp);
#endif
}
else {
output_P(status, (TOPIC_POWER), (PAYLOAD_POWER_OFF));
power_status = off;
#ifdef POWERON_WHEN_CHANGING_MODE
output_P(status, PSTR(TOPIC_MODE), PSTR(PAYLOAD_MODE_OFF));
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/support.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "MHI-AC-Ctrl-core.h"
#include "MHI-AC-Ctrl.h"

#define VERSION "2.6"
#define VERSION "2.7R1"

#define WIFI_SSID ""
#define WIFI_PASSWORD ""
Expand Down