GithubHelp home page GithubHelp logo

mhi-ac-ctrl-esphome's Introduction

"Buy Me A Coffee" paypal RobertJansen1

MHI-AC-Ctrl-ESPHome

This project is a simple integration of the amazing work absalom-muc has done with his project MHI-AC-Ctrl.
It's supposed to simplify the Home Assistant setup, while giving you OTA and auto-discovery with virtually zero effort and no MQTT needed, powered by ESPHome.
MHI-AC-Ctrl-core.* files were forked directly, with no modification, whereas your WiFi credentials should go into the *.yaml file, and mhi_ac_ctrl.h is the core of the integration.
Just put all these files in your ESPHome folder, flash once, and you're good to go!

Fan Modes Up/Down Left/Right

Most newer MHI units (the ones supporting the WF-RAC WiFi module) support fine grained vane control for Left/Right and Up/Down.
When your log is flooded with mhi_ac_ctrl_core.loop error: -2 errors after updating to the newer code, please change your yaml file to include the legacy file instead of the large_framesize.yaml.
Currently the MHI code allows for more fine grained fan direction than esphome climate supports. for that, additional template parts are added.
There are 8 modes for Left/Right: Left, Left/Center, Center, Center/Right, Right, Wide, Spot and Swing
There are 5 modes for Up/Down: Up, Up/Center, Center/Down, Down and Swing
Setting swing from the esphome climate now fully works. It will store the oldvanes mode, and configure swing. after disabling swing (either vertically, horizontally or off), the old settings will be restored. Manually changing modes for Left/Right or Up/Down will update the climate state as well.

Climate Quiet

Climate Quiet was added to ESPhome, so QUIET was added. ordering still needs work (#22 (comment)) Added the solution for the auto mode from: #22 (comment): CLIMATE_FAN_DIFFUSE in fan speed and status sections and reshuffle the numbers and add CLIMATE_FAN_DIFFUSE to the traits.set_supported_fan_modes

Has now 5 different fan modes but I'm not sure if the auto mode works proper, keep testing.

Changelog:

v2.1 (2024-03)

  • Breaking change: Cleaned up conf files
  • Add restart button
  • Update Home Assistant naming convention
  • Enable energy dashboard usage

v2.0 (2024-01)

  • Based on absalom-muc v2.8 (September 2023)
  • Breaking change in YAML configuration (need to set frame_size in globals)
  • Added legacy support configurable from YAML (removing 3d auto and vanes LR control)

License

This project is licensed under the MIT License - see the LICENSE file for details.
(TL;DR: Do whatever you want with the code, no warranty given, give credit where it's due.)

mhi-ac-ctrl-esphome's People

Contributors

arpiecodes avatar bill-dung avatar deku-m avatar ginkage avatar gurtknev avatar hmmbob avatar robertjansen1 avatar robomagus avatar serrj-sv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mhi-ac-ctrl-esphome's Issues

Vane up/down control resets vane left/right

Hi, in #38 vane control was added but I have a weird issue with this and I wonder if I'm the only one :)

When I set my left/right vane (with the IR) and then later call the new vane control service to set my up/down vane to something, let's say "4", the vane goes to the bottom as expected but the left/right vanes reset to the middle!

Could it perhaps be that the signal sent for the new up/down vane control also includes a left/right position?

Also tagging absalom-muc/MHI-AC-Ctrl#77 here because there is some development going on there.

Using a Honeywell T6 for the room temperature

Hi There,

I am bit new in this all and when I asked a stupid question I'm sorry :-)

I have two AC's. One in the livingroom and one in the bedroom. Both have the wifi controller with MHI-AC-Ctrl-ESPHome software on it and they work fine (after 2 weeks of messing around).
Setting the temp is aways a guess because depending on heating, or cooling, the offset is different.
In the living room I have the Honeywell T6 that is attached the the normal heater (is hardly used) and that always has the right temp.
Is it possible to use the Honeywel as the room temp by the airco and how do I do that?

Thanks,

Marcel

Multiple units

Hi there - first thanks for getting this into esphome
Newbie here - when i flash 2 units both of them start to get random disconnect and become unavailable in esphome .
As far as i understood that might be because of the id , however if i change it it fails to compile .
What changes should i make in order to connect more than 1 unit in the same network ?

Strange temperature issue

Hi,

I moved from the MQTT-Version to your ESPHome-alternative. I have used the current MHI-code.

I am having the problem that the temperature is really volatile. Each time after adjusting it to 20 C the value jumps to a 148 C or 164 C.

Even when the air conditioning is on.

Do you have an idea?

Power Status always on on reboot

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)

Low, Medium, High, Auto

Hi,

Low, Medium, High seems to do what they should, at least, it starts low, then medium, then high. But the auto blows all paper from the desk and does not really seem to be going "down" or "up", just at boost speed.

Why?

Can't set airco mode in web server

Since today on all my devices I am not able to select the airco mode (Cooling, heating, fan only etc in the web server anymore.
Even if I upload a old .bin file this functionality is gone.

mhi_ac_ctrl_core.loop error: -4

Hi, I just installed this device, I have no airco readings.
The Wemos d1 is connected to HA (all diagnostic values are there).

In the esphome log it continuously shows: mhi_ac_ctrl_core.loop error: -4

Any clue?

Thanks,
Koen

Component <unknown> took a long time for an operation

I have a SRF35ZS-W connected and all automations and scripts work fine with it, but I see this very often in the log:

[component: 204 ] Component took a long time for an operation (0.06 s) .
[component: 205 ] Components should block for at most 20-30ms.

With the other 3 units SRK25ZS-W I see the same messages also, but not as often as with the SRF35ZS-W

Any idea where this warnings comes from and if there is a way to solve this?

What is meant by "Just put all these files in your ESPHome folder"?

This is probably a silly question but despite 20 years experience in software development , what is meant by "Just put all these files in your ESPHome folder"? Because if I check out the code of this repo, then copy in all the files from the original project, then surely the files which have the same name will get overwritten and it will simply be running the original code? Am I being stupid? :)

How should you merge the source folders so this extension still works? I feel like there's a step missing from the instructions or something?

[Feature Request] Make this available as a custom component

Since the files provided seem to be changing and get updates every now and then I was wondering if it would be possible to convert the repo to be used as custom components within ESPHome.
I know that https://github.com/tfyoung/esphome-MHIHeatPump has already done this with another version. However I thought it makes sense maybe here as well so everyone using will get the latest version without the need of manually update all files every time.

Thanks also for the great work making this available in ESPHome. ❤️

Control fanspeed and swingposition through webserver

In my ESPHome code, I have enabled the webserver for my module:

web_server:
  port: 80

In the webserver, all sensor data available in HomeAssistant is also shown here. The controls for the AC are very limited though.
It is only possible to set the temperature and the mode. Within HomeAssistant I can also change the fanspeed and swingposition, which are attributes of the climate component.

Is it possible to make fanspeed and swingposition also available in the webserver?

publish roomtemperature like with MQTT

not really an issue, but with MQTT its possible to publish the temperature value of an external sensor instead of using the AC internal sensor. i havent been able to do this with the esphome version, is it possible?

A few questions

hi, thanks for converting to esphome, much preferred

wondering if you could answer the following

Do i need to add the api: part in the yaml to show up in HA

Upon restarting the esp8266, the state changes to cool in HA even though not on.?

Since ESPheom update I get an error: warning: 'esphome::climate::Climate::away' is deprecated: away is deprecated, use preset instead [-Wdeprecated-declarations]

Compiling /data/aircozolder/.pioenvs/aircozolder/libaf0/Hash/Hash.cpp.o
In file included from src/esphome/core/controller.h:29,
                 from src/esphome/components/api/api_server.h:4,
                 from src/esphome/components/api/api_connection.h:6,
                 from src/esphome.h:3,
                 from src/main.cpp:3:
src/esphome/components/climate/climate.h: In constructor 'esphome::climate::Climate::Climate()':
src/esphome/components/climate/climate.h:167:7: warning: 'esphome::climate::Climate::away' is deprecated: away is deprecated, use preset instead [-Wdeprecated-declarations]
  167 | class Climate : public EntityBase {
      |       ^~~~~~~
src/esphome/components/climate/climate.h:193:8: note: declared here
  193 |   bool away{false};
      |        ^~~~
src/esphome/components/climate/climate.h:167:7: warning: 'esphome::climate::Climate::away' is deprecated: away is deprecated, use preset instead [-Wdeprecated-declarations]
  167 | class Climate : public EntityBase {
      |       ^~~~~~~
src/esphome/components/climate/climate.h:193:8: note: declared here
  193 |   bool away{false};
      |        ^~~~
In file included from src/main.cpp:64:
src/mhi_ac_ctrl.h: In constructor 'MhiAcCtrl::MhiAcCtrl()':
src/mhi_ac_ctrl.h:8:7: note: synthesized method 'esphome::climate::Climate::Climate()' first required here
    8 | class MhiAcCtrl : public climate::Climate,
      |       ^~~~~~~~~
/config/esphome/aircozolder.yaml: In lambda function:
/config/esphome/aircozolder.yaml:65:40: note: synthesized method 'MhiAcCtrl::MhiAcCtrl()' first required here
   65 |       auto mhi_ac_ctrl = new MhiAcCtrl();
      |                                        ^
Compiling /data/aircozolder/.pioenvs/aircozolder/lib67b/ESP8266WiFi/BearSSLHelpers.cpp.o

Node not available after flashing

Hi,

First of all, thank you for this easy implementation of the heatpump API using ESPHome.
I placed the 3 .cpp/.h files in the root of the ESPHome directory of my HA instance, configured the yaml as described. But after flashing the interface returns this message:

image

Is this expected or did i do something wrong?

Also, the climate entity does not show up in homeassistant.
Any idea what this could be?

Thanks for now

Added 3D auto and vanes L/R support

Hi,
The original module got updated last week with USE_EXTENDED_FRAME_SIZE like WF-RAC module.
absalom-muc/MHI-AC-Ctrl@6d747e1
Have you already tried to update this esphome fork?
II think that these commands are not supported by esphome climate entities. Should I try to make a service like actual vanes control?

Vanes control question

Hi,

I'm not sure if I'm doing anything wrong or if this is a limitation of using Home Assistant with ESPHome instead of working with the MQTT stuff in the original absalom-muc project, but I'm not able to control the vane (up/down) position.

I can set a swing mode to "off" or "vertical" and this kind of works:
image

Swing does swing, but "off" always sets the vane to the upmost position.

I see in MHI-AC-Ctrl-core.h

vanes_1 = 1, vanes_2 = 2, vanes_3 = 3, vanes_4 = 4, vanes_unknown = 0, vanes_swing = 5

There are 4 positions and swing to work with.

And in the absalom-muc project there is a screenshot of vane control:
image

Is it possible to get this in Home Assistant with ESPHome?

Greetings,
Ralf.

It is getting much warmer then setpoint

Hi! I'm not sure whether this is a bug yet but I'd love to hear your experience and perhaps we can figure this out.

I don't use the HA integration during cooling season a lot, the previous heating season was a while ago and I updated to the latest version with a lot of changes so my past experience isn't that useful.

So I just started using the heating of my AC again and notice it is getting much warmer then I expect.

Screenshot_2023-10-22-10-22-31-05_c3a231c25ed346e59462e84656a70e50~2

I have the target temperature set on 19 C. After a while the temperature in HA on the climate device shows 22 or 22.5 C.

Screenshot_2023-10-22-12-14-02-45_c3a231c25ed346e59462e84656a70e50

I have a couple of devices in the same area reporting temperature at 20 to 20.5 C.

I don't mind that the climate device in HA shows too high of a temperature, but the room is actually getting too warm.

I need to test with IR remote only to see if this is also the case when I set the temperature with the remote. But how is your experience with this?

Does not compile in ESPhome

Hi, thanks for transferring this to ESPhome. Unfortunately it does not compile in my ESPhome V 1.19.4. I tried with ESP8266 Wemos D1 mini. The Error report:

In file included from src/main.cpp:17:0:
src/mhi_ac_ctrl.h: In member function 'virtual void MhiAcCtrl::control(const esphome::climate::ClimateCall&)':
src/mhi_ac_ctrl.h:323:35: error: switch quantity not an integer
switch (this->fan_mode) {

Do you have an idea whats the problem?

Thank you very much!
Johannes

State change towards Home Assistant

Something strange is going on when letting the device sit idle. It changes to Unavailable and a couple of seconds later the reported state is that it's one with a specific HVAC_mode. However, the actual device itself stays turned off, it's only the Wemos D1 mini chip that updates it's state.
image

When turning on heating - temp up by 2 degrees

I have noticed that when I turn on heating the temp is upped by 2 degrees.

it is also in the logs:

[13:15:22][D][climate:385]: 'Airco' - Sending state:
[13:15:22][D][climate:388]:   Mode: HEAT
[13:15:22][D][climate:393]:   Fan Mode: LOW
[13:15:22][D][climate:405]:   Swing Mode: VERTICAL
[13:15:22][D][climate:408]:   Current Temperature: 22.25°C
**[13:15:22][D][climate:414]:   Target Temperature: 23.00°C**
[13:15:22][D][mhi_ac_ctrl:094]: received status=137 value=106 power=1
[13:15:33][D][sensor:126]: 'Airco Uptime': Sending state 71044.69531 s with 0 decimals of accuracy
[13:15:35][D][sensor:126]: 'Airco WiFi Signal': Sending state -59.00000 dBm with 0 decimals of accuracy
[13:15:36][D][sensor:126]: 'Airco - Current Power': Sending state 0.00000 W with 1 decimals of accuracy
[13:15:36][D][sensor:126]: 'Airco - Usage': Sending state 0.14311 kWh with 3 decimals of accuracy
[13:15:36][D][mhi_ac_ctrl:074]: did not receive a room_temp_api value, using IU temperature sensor
[13:15:40][D][mhi_ac_ctrl:094]: received status=130 value=50 power=1
[13:15:40][D][climate:385]: 'Airco' - Sending state:
[13:15:40][D][climate:388]:   Mode: HEAT
[13:15:40][D][climate:393]:   Fan Mode: LOW
[13:15:40][D][climate:405]:   Swing Mode: VERTICAL
[13:15:40][D][climate:408]:   Current Temperature: 22.25°C
**[13:15:40][D][climate:414]:   Target Temperature: 25.00°C**
[13:15:46][D][mhi_ac_ctrl:094]: received status=135 value=83 power=1
[13:15:48][D][mhi_ac_ctrl:094]: received status=136 value=251 power=1

i did not up that myself...

What/Why is that?

ESP32 - D1 Mini Pro

Hi, I have tried to use a D1 Mini Pro ESP32 instead of an ESP8266. But to no avail, it just wont boot.

I want to use the advantage of also using the new bluetooth proxy component in the ESP32.

Is there any hard coding towards ESP8266?

Is it possible to use an ESP32?

board type: wemos_d1_mini32

[ERROR] during code compile in ESPHome

Hi

I have been attempting to setup 3 devices using your ESPHome integration.
Unfortunately when I try to flash it and upon first compile of the app I get the following errors relating to method depreciated.
I'm just wondering if there is anything I can do to remove these errors as shows below .

INFO Reading configuration /config/esphome/lr_mhi_ac_ctrl.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running: platformio run -d /config/esphome/lr_mhi_ac_ctrl
Processing lr_mhi_ac_ctrl (board: d1_mini; framework: arduino; platform: platformio/[email protected])

HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif8266 3.20704.0 (2.7.4)
  • tool-esptool 1.413.0 (4.13)
  • tool-esptoolpy 1.20800.0 (2.8.0)
  • toolchain-xtensa 2.40802.200502 (4.8.2)
    Library Manager: Installing Update
    Library Manager: Already installed, built-in library
    Dependency Graph
    |-- 1.0
    |-- 1.2
    | |-- 1.0
    Compiling /data/lr_mhi_ac_ctrl/.pioenvs/lr_mhi_ac_ctrl/src/main.cpp.o
    Generating LD script /data/lr_mhi_ac_ctrl/.pioenvs/lr_mhi_ac_ctrl/ld/local.eagle.app.v6.common.ld
    Compiling /data/lr_mhi_ac_ctrl/.pioenvs/lr_mhi_ac_ctrl/lib4d9/ESP8266WiFi/BearSSLHelpers.cpp.o
    In file included from src/main.cpp:10:0:
    src/mhi_ac_ctrl.h: In member function 'virtual void MhiAcCtrl::control(const esphome::climate::ClimateCall&)':
    src/mhi_ac_ctrl.h:307:35: error: switch quantity not an integer
    switch (this->fan_mode) {
    ^
    src/mhi_ac_ctrl.h: In member function 'virtual esphome::climate::ClimateTraits MhiAcCtrl::traits()':
    src/mhi_ac_ctrl.h:352:43: warning: 'void esphome::climate::ClimateTraits::set_supports_auto_mode(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:54): This method is deprecated, use set_supported_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_auto_mode(true);
    ^
    src/mhi_ac_ctrl.h:353:43: warning: 'void esphome::climate::ClimateTraits::set_supports_cool_mode(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:56): This method is deprecated, use set_supported_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_cool_mode(true);
    ^
    src/mhi_ac_ctrl.h:354:43: warning: 'void esphome::climate::ClimateTraits::set_supports_heat_mode(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:58): This method is deprecated, use set_supported_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_heat_mode(true);
    ^
    src/mhi_ac_ctrl.h:355:42: warning: 'void esphome::climate::ClimateTraits::set_supports_dry_mode(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:66): This method is deprecated, use set_supported_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_dry_mode(true);
    ^
    src/mhi_ac_ctrl.h:356:47: warning: 'void esphome::climate::ClimateTraits::set_supports_fan_only_mode(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:62): This method is deprecated, use set_supported_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_fan_only_mode(true);
    ^
    src/mhi_ac_ctrl.h:358:39: warning: 'void esphome::climate::ClimateTraits::set_supports_away(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:119): This method is deprecated, use set_supported_presets() instead [-Wdeprecated-declarations]
    traits.set_supports_away(false);
    ^
    src/mhi_ac_ctrl.h:362:47: warning: 'void esphome::climate::ClimateTraits::set_supports_fan_mode_auto(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:80): This method is deprecated, use set_supported_fan_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_fan_mode_auto(true);
    ^
    src/mhi_ac_ctrl.h:363:47: warning: 'void esphome::climate::ClimateTraits::set_supports_fan_mode_high(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:86): This method is deprecated, use set_supported_fan_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_fan_mode_high(true);
    ^
    src/mhi_ac_ctrl.h:364:46: warning: 'void esphome::climate::ClimateTraits::set_supports_fan_mode_low(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:82): This method is deprecated, use set_supported_fan_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_fan_mode_low(true);
    ^
    src/mhi_ac_ctrl.h:365:49: warning: 'void esphome::climate::ClimateTraits::set_supports_fan_mode_medium(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:84): This method is deprecated, use set_supported_fan_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_fan_mode_medium(true);
    ^
    src/mhi_ac_ctrl.h:366:48: warning: 'void esphome::climate::ClimateTraits::set_supports_swing_mode_off(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:131): This method is deprecated, use set_supported_fan_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_swing_mode_off(true);
    ^
    src/mhi_ac_ctrl.h:367:49: warning: 'void esphome::climate::ClimateTraits::set_supports_swing_mode_both(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:133): This method is deprecated, use set_supported_fan_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_swing_mode_both(true);
    ^
    src/mhi_ac_ctrl.h:368:53: warning: 'void esphome::climate::ClimateTraits::set_supports_swing_mode_vertical(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:135): This method is deprecated, use set_supported_fan_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_swing_mode_vertical(true);
    ^
    src/mhi_ac_ctrl.h:369:55: warning: 'void esphome::climate::ClimateTraits::set_supports_swing_mode_horizontal(bool)' is deprecated (declared at src/esphome/components/climate/climate_traits.h:137): This method is deprecated, use set_supported_fan_modes() instead [-Wdeprecated-declarations]
    traits.set_supports_swing_mode_horizontal(true);
    ^
    Compiling /data/lr_mhi_ac_ctrl/.pioenvs/lr_mhi_ac_ctrl/lib4d9/ESP8266WiFi/CertStoreBearSSL.cpp.o
    *** [/data/lr_mhi_ac_ctrl/.pioenvs/lr_mhi_ac_ctrl/src/main.cpp.o] Error 1
    ========================== [FAILED] Took 3.56 seconds ==========================

Compiling warnings in 2022.06 ESPhome

Hi

When compiling with the new ESPhome 2022.06 it gives warnings of deprecated objects:
See below:

Compiling /data/airco-woonkamer/.pioenvs/airco-woonkamer/src/esphome/components/api/api_connection.cpp.o
src/MHI-AC-Ctrl-core.cpp: In function 'void MeasureFrequency(CallbackInterface_Status*)':
src/MHI-AC-Ctrl-core.cpp:65:53: warning: 'void handleInterrupt_SCK()' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations]
   65 |     attachInterrupt(digitalPinToInterrupt(SCK_PIN), handleInterrupt_SCK, RISING);
      |                                                     ^~~~~~~~~~~~~~~~~~~
src/MHI-AC-Ctrl-core.cpp:46:22: note: declared here
   46 | ICACHE_RAM_ATTR void handleInterrupt_SCK() {
      |                      ^~~~~~~~~~~~~~~~~~~
src/MHI-AC-Ctrl-core.cpp:65:80: warning: 'void handleInterrupt_SCK()' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations]
   65 |     attachInterrupt(digitalPinToInterrupt(SCK_PIN), handleInterrupt_SCK, RISING);
      |                                                                                ^
src/MHI-AC-Ctrl-core.cpp:46:22: note: declared here
   46 | ICACHE_RAM_ATTR void handleInterrupt_SCK() {
      |                      ^~~~~~~~~~~~~~~~~~~
src/MHI-AC-Ctrl-core.cpp:66:54: warning: 'void handleInterrupt_MOSI()' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations]
   66 |     attachInterrupt(digitalPinToInterrupt(MOSI_PIN), handleInterrupt_MOSI, RISING);
      |                                                      ^~~~~~~~~~~~~~~~~~~~
src/MHI-AC-Ctrl-core.cpp:51:22: note: declared here
   51 | ICACHE_RAM_ATTR void handleInterrupt_MOSI() {
      |                      ^~~~~~~~~~~~~~~~~~~~
src/MHI-AC-Ctrl-core.cpp:66:82: warning: 'void handleInterrupt_MOSI()' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations]
   66 |     attachInterrupt(digitalPinToInterrupt(MOSI_PIN), handleInterrupt_MOSI, RISING);
      |                                                                                  ^
src/MHI-AC-Ctrl-core.cpp:51:22: note: declared here
   51 | ICACHE_RAM_ATTR void handleInterrupt_MOSI() {
      |                      ^~~~~~~~~~~~~~~~~~~~
src/MHI-AC-Ctrl-core.cpp:67:54: warning: 'void handleInterrupt_MISO()' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations]
   67 |     attachInterrupt(digitalPinToInterrupt(MISO_PIN), handleInterrupt_MISO, RISING);
      |                                                      ^~~~~~~~~~~~~~~~~~~~
src/MHI-AC-Ctrl-core.cpp:56:22: note: declared here
   56 | ICACHE_RAM_ATTR void handleInterrupt_MISO() {
      |                      ^~~~~~~~~~~~~~~~~~~~
src/MHI-AC-Ctrl-core.cpp:67:82: warning: 'void handleInterrupt_MISO()' is deprecated: Use IRAM_ATTR in place of ICACHE_RAM_ATTR to move functions into IRAM [-Wdeprecated-declarations]
   67 |     attachInterrupt(digitalPinToInterrupt(MISO_PIN), handleInterrupt_MISO, RISING);
      |                                                                                  ^
src/MHI-AC-Ctrl-core.cpp:56:22: note: declared here
   56 | ICACHE_RAM_ATTR void handleInterrupt_MISO() {
      |                      ^~~~~~~~~~~~~~~~~~~~

Might be only to change IRAM_ATTR instead of ICACHE_RAM_ATTR in file MHI-AC-Ctrl-core.cpp

Understanding energy consumption

I have 4x MHI srk20 zm-s (4 rooms) with 2x SCM40ZM-S (so 2 inside units on 1 outside units).

Two questions:
a) Can someone explain what the energy sensor exactly report? Is there some form of double counting or is the sum of the 4 ESP units also the real sum of the daily energy consumption?

b) 2 of the 4 units report a significant higher 'standby' use then the other 2. Up to 300w per day while they are totally off. See the graphs below. Does anyone have an explanation for that? The sensors show no pump or fan activity in all cases.

Thanks

AC Power (comparing the 2 to show the different behavior):
Screenshot 2023-05-21 at 20 27 50
Screenshot 2023-05-21 at 20 27 34

AC Energy (all overlayed):
Screenshot 2023-05-21 at 20 36 37

sensors not working with latest Home Assistant / ESPHome

during compilation, the following error shows up:

Compiling /data/airco-dg/.pioenvs/airco-dg/src/main.cpp.o
In file included from src/main.cpp:34:
src/mhi_ac_ctrl.h: In member function 'virtual void MhiAcCtrl::cbiStatusFunction(ACStatus, int)':
src/mhi_ac_ctrl.h:55:16: warning: enumeration value 'status_mqtt_lost' not handled in switch [-Wswitch]
55 | switch (status) {
| ^
src/mhi_ac_ctrl.h:55:16: warning: enumeration value 'status_wifi_lost' not handled in switch [-Wswitch]
/config/esphome/airco-dg.yaml: In lambda function:
/config/esphome/airco-dg.yaml:50:44: error: 'class MhiAcCtrl' has no member named 'get_sensors'
50 | return ((MhiAcCtrl*)mhi_ac_ctrl_dg)->get_sensors();
| ^~~~~~~~~~~
/config/esphome/airco-dg.yaml: In lambda function:
/config/esphome/airco-dg.yaml:59:44: error: 'class MhiAcCtrl' has no member named 'get_binary_sensors'
59 | return ((MhiAcCtrl*)mhi_ac_ctrl_dg)->get_binary_sensors();
| ^~~~~~~~~~~~~~~~~~
*** [/data/airco-dg/.pioenvs/airco-dg/src/main.cpp.o] Error 1
========================= [FAILED] Took 12.23 seconds =========================

Temperature setting

Is there a possibility to set the temperature per 0,5 degree or are we stuck to rounding to the nearest integer?

Odd behaviour ...

Hi,
I've tried to get your version running but struggle with an odd behaviour.

If I compile and flash the device OTA with just the core info (ESPHome 1.19.4)

esphome:
  name: lr_mhi_ac_ctrl
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: !secret wlan_name
  password: !secret wlan_password

logger:
  level: DEBUG
  baud_rate: 0

api:
  reboot_timeout: 0s

ota:

the device connects to WIFI and shows up in HA (but obviously does nothing ;-)). If I add the includes: and climate: sections the devices flashes correctly and I can ping it. Beyond that, no luck.

INFO Reading configuration /config/esphome/lr_mhi_ac_ctrl.yaml...
INFO Starting log output from 192.168.178.44 using esphome API
INFO Connecting to 192.168.178.44:6053 (192.168.178.44)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.178.44: [Errno 111] Connection refused). Re-Trying in 1 seconds
INFO Connecting to 192.168.178.44:6053 (192.168.178.44)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.178.44: [Errno 111] Connection refused). Re-Trying in 1 seconds
INFO Connecting to 192.168.178.44:6053 (192.168.178.44)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.178.44: [Errno 111] Connection refused). Re-Trying in 2 seconds

This is the second yaml file

esphome:
  name: lr_mhi_ac_ctrl
  platform: ESP8266
  board: d1_mini
  includes:
    - mhi_ac_ctrl.h
    - MHI-AC-Ctrl-core.h
    - MHI-AC-Ctrl-core.cpp

wifi:
  ssid: !secret wlan_name
  password: !secret wlan_password

logger:
  level: DEBUG
  baud_rate: 0

api:
  reboot_timeout: 0s

ota:

climate:
  - platform: custom
    lambda: |-
      auto mhi_ac_ctrl = new MhiAcCtrl();
      App.register_component(mhi_ac_ctrl);
      return {mhi_ac_ctrl};

    climates:
      - name: "MHI-AC-Ctrl"
        id: mhi_ac_ctrl

Any idea?

Restore previous settings from hassio

First thank you for this nice port of the software, it works almost flawlessly for me.
However, sometimes the esphome restarts (once a day or something, due to unknown reasons) and the HAVC is turned off (due to the default off setting in the code).

Do you know if there is a possibility to read out the current value exposed by home assistant?, as you do not want to default the HAVC to cooling (as restarting the system will consequently turn on the unit.)

Does crash on boot

I compiled it via the newest esphome on homeassistant
downloaded the bin and tried flashing it via esphomeflasher
Then I got a reboot loop :/

Showing logs:
[15:43:41]
[15:43:41]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[15:43:41]
[15:43:41]Soft WDT reset
[15:43:41]
[15:43:41]>>>stack>>>
[15:43:41]
[15:43:41]ctx: cont
[15:43:41]sp: 3ffffc80 end: 3fffffc0 offset: 01a0
[15:43:41]3ffffe20:  00000064 3fff1b84 0000051c 40201289  
[15:43:41]3ffffe30:  00000000 00000000 00000008 00000000  
[15:43:41]3ffffe40:  3ffe84dc 3fff03c8 4bc6a7f0 00000000  
[15:43:41]3ffffe50:  00000000 00000000 40100722 00000102  
[15:43:41]3ffffe60:  3fff182c 00000002 3fff03ec 4020ffe2  
[15:43:41]3ffffe70:  3fff182c 0000051c 3fff182c 40210004  
[15:43:41]3ffffe80:  0000051c 00000002 3fff03ec 4021d6b4  
[15:43:41]3ffffe90:  3fff0e9c 00000003 3fff03ec 4021d725  
[15:43:41]3ffffea0:  3fff182c 00000002 3fff03ec 4020ea00  
[15:43:41]3ffffeb0:  3fff0e9c 00000003 3fff1e28 3fff08d8  
[15:43:41]3ffffec0:  00000100 00000008 00000002 4022655a  
[15:43:41]3ffffed0:  3fffff74 3fff1a5c 3fff1c68 3fff1c68  
[15:43:41]3ffffee0:  3fff1a6c 3fff1a5c 3fff03ec 40210f62  
[15:43:41]3ffffef0:  3fff1970 00000000 00000000 3fff1988  
[15:43:41]3fffff00:  00000000 00000000 00000000 4021e780  
[15:43:41]3fffff10:  00000000 4021e780 00000000 4021e780  
[15:43:41]3fffff20:  00000000 4021e780 00000000 4021e780  
[15:43:41]3fffff30:  00000000 00000000 3fff1c68 feefeffe  
[15:43:41]3fffff40:  40210294 4021078c 3fff1e10 3fff1a70  
[15:43:41]3fffff50:  3fff1a70 3fff1c0c 00000000 00000000  
[15:43:41]3fffff60:  3fff1cfc 3fff1d00 3fff1d00 3fff1bb0  
[15:43:41]3fffff70:  3fff1ae4 feefeffe feefeffe feefeffe  
[15:43:41]3fffff80:  3fff1c0c feefeffe feefeffe feefeffe  
[15:43:41]3fffff90:  feefeffe feefeffe feefeffe 3fff0714  
[15:43:41]3fffffa0:  3fffdad0 00000000 3fff06d4 4021ac4c  
[15:43:41]3fffffb0:  feefeffe feefeffe 3ffe8508 40100599  
[15:43:41]<<<stack<<<
[15:43:41]
[15:43:41]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[15:43:41]
[15:43:41] ets Jan  8 2013,rst cause:2, boot mode:(3,6)
[15:43:41]
[15:43:41]load 0x4010f000, len 3584, room 16 
[15:43:41]tail 0
[15:43:41]chksum 0xb0
[15:43:41]csum 0xb0
[15:43:41]v2843a5ac
[15:43:41]~ld
[15:43:44]

(Default) update_interval?

what is the (default)update_interval for:

- platform: custom
lambda: |-
return ((MhiAcCtrl*)id(${deviceid}))->get_sensors();
# Sensor names in HA, you can change these if you want
# Don't delete them or change their position in the list
sensors:
- name: ${devicename} error code
- name: ${devicename} outdoor temperature
- name: ${devicename} return air temperature
- name: ${devicename} outdoor unit fan speed
- name: ${devicename} indoor unit fan speed
- name: ${devicename} current power
- name: ${devicename} compressor frequency
- name: ${devicename} indoor unit total run time
- name: ${devicename} compressor total run time
- name: ${devicename} vanes

Current power - indoor and/or outdoor?

Having a split unit and wondering if the current power is read from the outdoor unit and/or indoor unit(s).

I have 2 indoor units and thus 2 esps and reading different values from both (might have to do with the refresh rate not being synchronous).

Thanks.

New Device discovered in HA but no Entities

Hi,

I've managed to successfully upload the D1 mini.
Home Assistant discovers a new device but there are no entities to control the AC.
I must be doing something wrong but I don't know what.
Do I need to add something in my configuration.yaml as well??

INFO Connecting to 10.0.14.46:6053 (10.0.14.46)
INFO Successfully connected to 10.0.14.46
[21:53:29][I][app:105]: ESPHome version 1.19.4 compiled on Jun 28 2021, 21:52:31
[21:53:29][C][wifi:484]: WiFi:
[21:53:29][C][wifi:344]: SSID: '***'[redacted]
[21:53:29][C][wifi:345]: IP Address: 10.0.14.46
[21:53:29][C][wifi:347]: BSSID: 68:FF:7B:6F:6E:80[redacted]
[21:53:29][C][wifi:348]: Hostname: 'airco'
[21:53:29][C][wifi:352]: Signal strength: -62 dB ▂▄▆█
[21:53:29][C][wifi:356]: Channel: 1
[21:53:29][C][wifi:357]: Subnet: 255.255.255.0
[21:53:29][C][wifi:358]: Gateway: 10.0.14.254
[21:53:29][C][wifi:359]: DNS1: (IP unset)
[21:53:29][C][wifi:360]: DNS2: (IP unset)
[21:53:29][C][logger:189]: Logger:
[21:53:29][C][logger:190]: Level: DEBUG
[21:53:29][C][logger:191]: Log Baud Rate: 0
[21:53:29][C][logger:192]: Hardware UART: UART0
[21:53:29][C][mhi_ac_ctrl:043]: MHI-AC-Ctrl Climate 'MHI-AC-Ctrl'
[21:53:29][C][mhi_ac_ctrl:044]: Min. Temperature: 16.0°C
[21:53:29][C][mhi_ac_ctrl:045]: Max. Temperature: 36.0°C
[21:53:29][C][mhi_ac_ctrl:046]: Supports HEAT: YES
[21:53:29][C][mhi_ac_ctrl:047]: Supports COOL: YES
[21:53:29][C][ota:029]: Over-The-Air Updates:
[21:53:29][C][ota:030]: Address: 10.0.14.46:8266
[21:53:29][C][api:095]: API Server:
[21:53:29][C][api:096]: Address: 10.0.14.46:6053
[21:53:36][D][api.connection:630]: Client 'Home Assistant 2021.6.6 (10.0.14.6)' connected successfully!

Possible to display technical values?

First of all: Great work! I already am using the MHI-AC-Ctrl in one of my airco controllers, but wanted to switch to ESPHome if possible. Your project made it possible to run my second airco with ESPHome. I like it!

Question:
With the original MHI-AC-Ctrl, a lot of technical values are send to MQTT, see below for an example. Is it also possible to read this data through your ESPHome version?

		connected = 1
		RSSI = -48
		fSCK = 3200	
		fMOSI = 520
		fMISO = 0
		Mode = off
		Power = off
		Fan = 1
		Vanes = ?
		Troom = 25.75
		Tsetpoint = 26
		Errorcode = 0
			OpData
				Mode = heat
				Tsetpoint = 26
				RETURN-AIR = 26.00
				THI-R1 = 46
				THI-R2 = 58
				IU-FANSPEED = 0
				OUTDOOR = 8.00
				COMP = 0.00
				THO-R1 = 1
				TD = 60
				THI-R3 = 52
				CT = 3.57
				PROTECTION-NO = 0
				OU-FANSPEED = 3
				DEFROST = off
				TOTAL-COMP-RUN = 100
				OU-EEV1 = 150
				TDSH = 14

Esphome node doesn't respond after plugging in to AC

Hi,

Weird problem. If I only feed the node with 12v through the buck converter, the node is responsive but doesn't of course show any meaningful data except for the wifi stuff. When I connect it to the AC, no data comes through even from the wifi stuff. I can still see from my router that the node is connected to wifi and I can flash it over the air.

Any ideas? I've checked the SPI wiring about 25 times now.

Fan modes don't seem to correlate to real fan mode

Right now there are 4 fan modes: Low, Medium, High, Auto

But the remote (SKR-ZSX at least) has 5 fan modes: Ultra-low, Low, Medium, High, Auto

Right now it seems that
(ESP = AC)
Low=Ultra-low
Medium=Low
High=Medium
Auto= High

So, Auto doesn't work (and i don't know if that is possible) and is actually putting the AC at the High fan mode.

It seems that Ultra-low should be added if possible and Auto should be renamed to High.
I'd love to have Auto or 3D Auto as options, but i don't know if that is actually possible and i'm definitely not a programmer.

Error's compiling ESPHome

Hi,

I get these errors while compiling in ESPhome:

In file included from src/main.cpp:10:0:
src/mhi_ac_ctrl.h: In member function 'virtual esphome::climate::ClimateTraits MhiAcCtrl::traits()':
src/mhi_ac_ctrl.h:352:16: error: 'class esphome::climate::ClimateTraits' has no member named 'set_supported_modes'
traits.set_supported_modes({ CLIMATE_MODE_AUTO, CLIMATE_MODE_COOL, CLIMATE_MODE_HEAT, CLIMATE_MODE_DRY, CLIMATE_MODE_FAN_ONLY });
^
In file included from src/main.cpp:10:0:
src/mhi_ac_ctrl.h:354:16: error: 'class esphome::climate::ClimateTraits' has no member named 'set_supported_presets'
traits.set_supported_presets({ CLIMATE_PRESET_NONE });
^
src/mhi_ac_ctrl.h:354:40: error: 'CLIMATE_PRESET_NONE' was not declared in this scope
traits.set_supported_presets({ CLIMATE_PRESET_NONE });
^
src/mhi_ac_ctrl.h:358:16: error: 'class esphome::climate::ClimateTraits' has no member named 'set_supported_fan_modes'
traits.set_supported_fan_modes({ CLIMATE_FAN_AUTO, CLIMATE_FAN_LOW, CLIMATE_FAN_MEDIUM, CLIMATE_FAN_HIGH });
^
src/mhi_ac_ctrl.h:359:16: error: 'class esphome::climate::ClimateTraits' has no member named 'set_supported_swing_modes'
traits.set_supported_swing_modes({ CLIMATE_SWING_OFF, CLIMATE_SWING_BOTH, CLIMATE_SWING_VERTICAL, CLIMATE_SWING_HORIZONTAL });
^
*** [/data/airco/.pioenvs/airco/src/main.cpp.o] Error 1
========================== [FAILED] Took 5.34 seconds ==========================

Add-on version: 1.16.2
You are running the latest version of this add-on.
System: Home Assistant OS 6.1 (amd64 / qemux86-64)
Home Assistant Core: 2021.6.6
Home Assistant Supervisor: 2021.06.6

Room Temperature

Is there a way to replace the room-temperature (return air temperature) with an external EvoHome sensor available in HA value to steer the units settings.
In my experience there is rather a big difference between the two where the EvoHome one is more accurate.

Strange temperature readings when at least one of my ACs is turned ON

Home Assistant Setup
Home Assistant: 2022.8.5
Supervisor: 2022.08.3
Operating System: 8.4
ESPHome: 2022.8.0

MHI-AC-Ctrl Setup
Hardware: D1 mini
External temperature probe used?: No
Firmware: MHI-AC-Ctrl-ESPHome

AC Setup

  • 4 * SRK35ZMXA-S
  • 3 * SRR35ZM-S

Problem Description
I'm in Australia where is in winter atm. When I turn on one or more ACs, the room temperature reading of almost all the other ACs (which are OFF) will rise up dramatically. The 2nd snapshot was captured around 15 minutes after I turned on the "Office AC" on the ground floor. As you find, the temperature readings of all the ACs of first floor are about 10-15 dgrees higher than the actual room temperature. I wonder if this issue is caused by mhi-ac-ctrl or the AC indoor unit itself? TIA!!!
image
image

Power to kWh

Is it possible to have a KwH sensor like below:

sensor:
  - platform: custom
    lambda: |-
      return ((MhiAcCtrl*)id(${deviceid}))->get_sensors();
    # Sensor names in HA, you can change these if you want
    # Don't delete them or change their position in the list
    sensors:
      - name: ${devicename} - Error Code
      - name: ${devicename} - Outdoor Temperature
      - name: ${devicename} - Return Air Temperature
      - name: ${devicename} - Outdoor Unit Fan Speed
      - name: ${devicename} - Indoor Unit Fan Speed
      - name: ${devicename} - Current Power
        id: power
      - name: ${devicename} - Compressor Frequency
      - name: ${devicename} - Indoor Unit Total Run Time
      - name: ${devicename} - Compressor Total Run Time

  - platform: total_daily_energy
    name: "${devicename} - Dagverbruik"
    power_id: "power"
    filters:
        # Multiplication factor from W to kW is 0.001
        - multiply: 0.001
        - throttle: 300s
    unit_of_measurement: kWh
    icon: mdi:clock-alert

I do not seem to get some output via "id:power"

DS18B20 as external temperature sensor

The original MHI-AC-Ctrl software and PCB have an option to connect a DS18B20 temperature sensor and use that sensor instead of the internal temperature sensor of the HVAC unit.
(upper left corner of: https://github.com/absalom-muc/MHI-AC-Ctrl/blob/master/images/PCB_top.PNG)
(https://github.com/absalom-muc/MHI-AC-Ctrl/blob/master/SW-Configuration.md#external-temperature-sensor-settings-supporth)

In the MHI-AC-Ctrl-ESPHome version, I couldn't find the option to use a connected DS18B20 temperature sensor.

Is it possible to add this feature to the code?

MHI-AC-Ctrl working MQTT communication with SRK 63 ZR, but MHI-AC-Ctrl-ESPHome does not show any communication

I tried first to run my SRK 63 ZR with the D1 Wemos with MHI-AC-Ctrl-ESPHome, this does nothing besides connecting with Wifi. I flashed this via the python interface from ESPHome.
Afterwards I tried to flash the D1 Wemos with the original MHI-AC-Ctrl project and then I can clearly see the MQTT communication working in the MQTT explorer.

What is going wrong? I saw somewhere in the files that it includes arduino.h, but I did not put that file in the directory, might that be the issue? Or anything else?
See attached the MQTT communication from the MHI-AC-Ctrl program.
Thanks!
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.