ginkage / MHI-AC-Ctrl-ESPHome

ESPHome integration for MHI-AC-Ctrl project
MIT License
101 stars 35 forks source link

AC working with MHI-AC-Ctrl but not with MHI-AC-Ctrl-ESPHome #68

Closed Stimuka closed 6 months ago

Stimuka commented 11 months ago

Hello,

Two days ago I installed my hardware in the AC unit which is a SRK20ZM-S and I uploaded the MHI-AC-Ctrl-ESPHome software on the ESP8266 which is a D1 Mini. Unfortunately I couldn't get it to work. All my sensors gave unknown values and also I didn't get the current temperature value or couldn't change HVAC modes.

Below is the output of the console when the MHI-AC-Ctrl-ESPHome software is active.

[I][wifi:519]: WiFi Connected! [C][wifi:363]: Local MAC: F4:CF:A2:65:FA:CD

[C][wifi:365]: IP Address: [C][wifi:366]: BSSID:

[C][wifi:370]: Signal strength: -76 dB [C][wifi:374]: Channel: 6 [C][wifi:375]: Subnet: 255.255.255.0 [C][wifi:376]: Gateway: 192.168.5.1 [C][wifi:377]: DNS1: 192.168.1.5 [C][wifi:378]: DNS2: 192.168.1.6 [D][wifi:528]: Disabling AP... [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][ota:093]: Over-The-Air Updates: [C][ota:094]: Address: lr_mhi_ac_ctrl.local:8266 [C][api:025]: Setting up Home Assistant API server... [I][app:062]: setup() finished successfully! [D][sensor:109]: 'Airco Slaapkamer WiFi Signal': Sending state -76.00000 dBm with 0 decimals of accuracy [D][text_sensor:064]: 'Airco Slaapkamer BSSID': Sending state '06:EC:DA:3B:F8:E1' [D][text_sensor:064]: 'Airco Slaapkamer SSID': Sending state '***' [D][text_sensor:064]: 'Airco Slaapkamer IP': Sending state '192.168.5.54' [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [I][app:102]: ESPHome version 2023.4.4 compiled on Nov 10 2023, 09:27:45

[C][wifi:363]: Local MAC: F4:CF:A2:65:FA:CD

[C][wifi:365]: IP Address: 192.168.5.54 [C][wifi:366]: BSSID: 5m06:EC:DA:3B:F8:E16m

[C][wifi:370]: Signal strength: -76 dB [C][wifi:374]: Channel: 6 [C][wifi:375]: Subnet: 255.255.255.0 [C][wifi:376]: Gateway: 192.168.5.1 [C][wifi:377]: DNS1: 192.168.1.5 [C][wifi:378]: DNS2: 192.168.1.6 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2

[C][logger:295]: Level: DEBUG [C][logger:296]: Log Baud Rate: 115200 [C][logger:297]: Hardware UART: UART0 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][uptime.sensor:031]: Uptime Sensor 'Airco Slaapkamer Uptime' [C][uptime.sensor:031]: Device Class: 'duration' [C][uptime.sensor:031]: State Class: 'total_increasing' [C][uptime.sensor:031]: Unit of Measurement: 's' [C][uptime.sensor:031]: Accuracy Decimals: 0

[W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][template.select:065]: Template Select 'Airco Slaapkamer Fan Control Left Right'

[C][template.select:066]: Update Interval: 60.0s [C][template.select:069]: Optimistic: YES [C][template.select:070]: Initial Option: Left [C][template.select:071]: Restore Value: NO [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][template.select:065]: Template Select 'Airco Slaapkamer Fan Control Up Down'

[C][template.select:066]: Update Interval: 60.0s [C][template.select:069]: Optimistic: YES [C][template.select:070]: Initial Option: Up [C][template.select:071]: Restore Value: NO [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][template.switch:075]: Template Switch 'Airco Slaapkamer 3D Auto'

[C][template.switch:097]: Restore Mode: always OFF [C][template.switch:060]: Restore State: NO [C][template.switch:061]: Optimistic: YES [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][mhi_ac_ctrl:144]: MHI-AC-Ctrl Climate 'Airco Slaapkamer' [C][mhi_ac_ctrl:145]: Min. Temperature: 18.0°C [C][mhi_ac_ctrl:146]: Max. Temperature: 30.0°C [C][mhi_ac_ctrl:147]: Supports HEAT: YES [C][mhi_ac_ctrl:148]: Supports COOL: YES [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][version.text_sensor:021]: Version Text Sensor 'Airco Slaapkamer ESPHome Version'

[W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2

[C][mdns:109]: Hostname: lr_mhi_ac_ctrl [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][ota:093]: Over-The-Air Updates: [C][ota:094]: Address: lr_mhi_ac_ctrl.local:8266 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][api:138]: API Server: [C][api:139]: Address: lr_mhi_ac_ctrl.local:6053 [C][api:143]: Using noise encryption: NO [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][wifi_signal.sensor:009]: WiFi Signal 'Airco Slaapkamer WiFi Signal' [C][wifi_signal.sensor:009]: Device Class: 'signal_strength' [C][wifi_signal.sensor:009]: State Class: 'measurement' [C][wifi_signal.sensor:009]: Unit of Measurement: 'dBm' [C][wifi_signal.sensor:009]: Accuracy Decimals: 0 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][wifi_info:009]: WifiInfo IPAddress 'Airco Slaapkamer IP' [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][wifi_info:011]: WifiInfo SSID 'Airco Slaapkamer SSID' [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [C][wifi_info:012]: WifiInfo BSSID 'Airco Slaapkamer BSSID' [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2 [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2

And then it just keeps coming up with '[W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2'

I also got a warning when compiling. But compiling went fine. See the warning below.

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:87: src\mhi_ac_ctrl.h: In constructor 'MhiAcCtrl::MhiAcCtrl()': src\mhi_ac_ctrl.h:31:7: note: synthesized method 'esphome::climate::Climate::Climate()' first required here 31 | class MhiAcCtrl : public climate::Climate, | ^~~~~ lr_mhi_ac_ctrl.yaml: In lambda function: lr_mhi_ac_ctrl.yaml:42:40: note: synthesized method 'MhiAcCtrl::MhiAcCtrl()' first required here

The strange thing is that is seems to work fine with the MHI-AC-Ctrl software. I seem to get data on the sensors and can also set the modes and can turn on and off the AC from MQTT. Below is the output from the console when the MHI-AC-Ctrl software is active.

Starting MHI-AC-Ctrl v2.8 CPU frequency[Hz]=80000000 ESP.getCoreVersion()=3.1.2 ESP.getSdkVersion()=2.2.2-dev(38a443e) ESP.checkFlashCRC()=1 Measure frequency for SCK, MOSI and MISO pin SCK frequency=4224Hz (expected: >3000Hz) o.k. MOSI frequency=746Hz (expected: <SCK frequency) o.k. MISO frequency=0Hz (expected: ~0Hz) o.k. OTA Ready setupWiFi: Start async scanNetworks WIFI_CONNECT_SCANNING handleWiFiScanResult(): 9 access points available 1 Thynet 2G 1 -59dBm FC:EC:DA:81:B2:34 secured 04 2 ShellyPlusI4-08B61FCDC510 1 -62dBm 08:B6:1F:CD:C5:11 open 07 3 ShellyPlusI4-90380C35F428 1 -70dBm 90:38:0C:35:F4:29 open 07 4 ShellyPlusI4-08B61FCDBE28 1 -66dBm 08:B6:1F:CD:BE:29 open 07 5 H369A6A4A4D 1 -87dBm 00:4A:77:6A:4A:4D secured 04 6 Ziggo 1 -79dBm 6A:02:98:40:9A:29 secured ff 7 Thynet 5G 1 -58dBm 02:EC:DA:81:B2:34 secured 04 8 Thynet 2G 6 -74dBm FC:EC:DA:3B:F8:E1 secured 04 9 Thynet 5G 6 -75dBm 02:EC:DA:3B:F8:E1 secured 04 current BSSID: FF:FF:FF:FF:FF:FF, strongest BSSID: FC:EC:DA:81:B2:34 Connecting from bssid:FF:FF:FF:FF:FF:FF to bssid:FC:EC:DA:81:B2:34, channel:1 WIFI_CONNECT_ONGOING connected to **, IP address: ** (-64dBm) WIFI_CONNECT_OK MQTTreconnect(): Attempting MQTT connection (MQTTclient.state=-1), WiFi.status()=3 ... connected MQTTclient.connected=1 status=64 topic=connected payload=1 status=64 topic=Version payload=2.8 status=64 topic=RSSI payload=-65 status=64 topic=WIFI_LOST payload=0 status=64 topic=MQTT_LOST payload=0 status=64 topic=WIFI_BSSID payload=FC:EC:DA:81:B2:34 MQTTreconnect(): 9 access points available status=64 topic=fSCK payload=4224 status=64 topic=fMOSI payload=746 status=64 topic=fMISO payload=0 status=65 topic=Mode payload=auto power_status: unknown; received status_power: 0 Set fan to Auto to fix fan status after powerdown (230V) AC status=64 topic=Power payload=OFF status=66 topic=Fan payload=auto status=67 topic=Vanes payload=Swing status=70 topic=Troom payload=18.75 status=71 topic=Tsetpoint payload=21.0 status=72 topic=Errorcode payload=0 status=130 topic=Tsetpoint payload=21.0 status=128 topic=Mode payload=auto mhi_ac_ctrl_core.loop error: -4 mhi_ac_ctrl_core.loop error: -4 status=131 topic=RETURN-AIR payload=19.00 status=135 topic=THI-R1 payload=16 status=136 topic=THI-R2 payload=56 status=137 topic=THI-R3 payload=16 mhi_ac_ctrl_core.loop error: -4 status=134 topic=IU-FANSPEED payload=0 mhi_ac_ctrl_core.loop error: -2 status=139 topic=TOTAL-IU-RUN payload=1900 mhi_ac_ctrl_core.loop error: -4 status=132 topic=OUTDOOR payload=6.25 mhi_ac_ctrl_core.loop error: -2 mhi_ac_ctrl_core.loop error: -2 status=133 topic=THO-R1 payload=0 mhi_ac_ctrl_core.loop error: -2 status=141 topic=COMP payload=0.00 mhi_ac_ctrl_core.loop error: -2 status=143 topic=TD payload=<=30 mhi_ac_ctrl_core.loop error: -1 status=142 topic=CT payload=0.00 mhi_ac_ctrl_core.loop error: -4 mhi_ac_ctrl_core.loop error: -4 mhi_ac_ctrl_core.loop error: -2 status=144 topic=TDSH payload=0 status=145 topic=PROTECTION-NO payload=0 status=138 topic=OU-FANSPEED payload=0 mhi_ac_ctrl_core.loop error: -2 status=146 topic=DEFROST payload=Off status=140 topic=TOTAL-COMP-RUN payload=1800 mhi_ac_ctrl_core.loop error: -4

What I have done so far is use different ESPHome versions. The versions I have used so far are 2023.2.0, 2023.4.4 and the latest. I have also used the MHI-AC-Ctrl-core.cpp and MHI-AC-Ctrl-core.h from the MHI-AC-Ctrl which was working for me. But nothing did the trick thus far.

One strange thing I saw from Home Assistant is that after about an hour of being connected some sensor are filled. The current temperature seems to be 19 degrees and does not change over a full night. Also the error code sensor got a value of 1.

damienmorrissey commented 10 months ago

I had the same problem. I didn't persist as long as you did (because I had the benefit of your post), however once I flashed the MHI-AC-Ctrl firmware it worked right away. I keep everything up to date so it was the latest version of esphome.

Something I was wondering- could the debug messages that have been added regarding timing be causing timing issues?

I have five units. I will try to get the model numbers. The three most modern units I have had a chance to install the modules on- the other two need to wait a couple of days as it's inconvenient to get to them. Out of the five I have four different models!

Stimuka commented 10 months ago

I am not sure if that is the problem. Last night however I installed the fork from @arpiecodes and everything seems to run fine. So there must be something significantly changed in one of the commits in this repository I think.

AlexzeyK commented 10 months ago

Guys, I think I found a solution to the problem : [W][mhi_ac_ctrl:139]: mhi_ac_ctrl_core.loop error: -2. take a look @https://github.com/ginkage/MHI-AC-Ctrl-ESPHome/issues/69

RobertJansen1 commented 9 months ago

This is because of the addition of 3dvanes which is not working on older units (and the bigger framesize is now the default)

if you install https://github.com/RobertJansen1/MHI-AC-Ctrl-ESPHome/tree/legacy_support and change the framesize to 20, the older units will continue working.

i patched the files and added an option to configure this setting from the yaml file. if this can be tested, it would be greatly appreciated and i can add documentation for it if this works :)

damienmorrissey commented 8 months ago

Team, I can confirm that this is indeed the case. All of my units (I have 5) need the smaller frame size.

I guess we could be smart and adjust the size of it fails. Best of both worlds? I might try to add that...

On Wed, 10 Jan 2024, 03:12 RobertJansen1, @.***> wrote:

This is because of the addition of 3dvanes which is not working on older units (and the bigger framesize is now the default)

if you install https://github.com/RobertJansen1/MHI-AC-Ctrl-ESPHome/tree/legacy_support and change the framesize to 20, the older units will continue working.

i patched the files and added an option to configure this setting from the yaml file. if this can be tested, it would be greatly appreciated and i can add documentation for it if this works :)

— Reply to this email directly, view it on GitHub https://github.com/ginkage/MHI-AC-Ctrl-ESPHome/issues/68#issuecomment-1883345770, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANALEHJ4DD2WZHXA2SOBSM3YNVT5LAVCNFSM6AAAAAA7F4WXFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBTGM2DKNZXGA . You are receiving this because you commented.Message ID: @.***>

Dennis-Q commented 8 months ago

@damienmorrissey it would be great if you can, but for now I am happy it's configurable via the esphome yaml.

In #69 I shared my experience regarding old and new units and the frame size and confirmed the legacy fix provided by @RobertJansen1 to be working.

Would you be able to share the model of your indoor units in the other issue mentioned so we het a list of legacy models not supporting the new frame size?

I do think it's good to consolidate both issues into one ticket as they seem to be duplicates.