ginkage / MHI-AC-Ctrl-ESPHome

ESPHome integration for MHI-AC-Ctrl project
MIT License
112 stars 39 forks source link

Power Status always on on reboot #30

Closed aferrato closed 2 months ago

aferrato commented 2 years ago

Hello, when the esp8266 is rebooted, the status of the air conditioner changes to on with the last mode used even if it is actually off.

I have tried what is written here #2, but it doesn't work.

To solve I added this code:

switch (this-> power_) {
     case 0:
         this-> mode = climate :: CLIMATE_MODE_OFF;
         this-> publish_state ();
         break;
     default:
         break;
 }

inside void cbiStatusFunction (ACStatus status, int value) override before switch (status)

ervee commented 2 years ago

I have this too. Will give your solution a try.

Edit: Just inserted that on line 93 in mhi_ac_ctrl.h, cleaned buid env. and recompiled and this works for me too!

sanderlv commented 2 years ago

Like this works indeed! image

ginkage commented 2 years ago

I've committed this workaround: https://github.com/ginkage/MHI-AC-Ctrl-ESPHome/commit/a43bc7187dba3ea520b662487ad94af0bdf9fdfb Please check if it works correctly.

sanderlv commented 2 years ago

I can confirm it works, thanks!

edit: this works: I've committed this workaround: https://github.com/ginkage/MHI-AC-Ctrl-ESPHome/commit/a43bc7187dba3ea520b662487ad94af0bdf9fdfb Please check if it works correctly.