absalom-muc / MHI-AC-Ctrl

Reads and writes data (e.g. power, mode, fan status etc.) from/to a Mitsubishi Heavy Industries (MHI) air conditioner (AC) via SPI controlled by MQTT
MIT License
269 stars 61 forks source link

MHI 18YXS2 Model #73

Closed kARTechnology closed 2 years ago

kARTechnology commented 2 years ago

I have successfully connected to my Indian Version (high efficiency 5.7 ISEER unit) to mhi-ac-ctrl 2.04. latest version with 2.2 has errors when ac isnt connected to the cns connector. crashes with exception in the mhi core loop(), found out that the changes from 2.04 to 2.2 have caused the issue.

some enhancements to make: 1) how to control the Horizontal Left/Right Vanes(7 modes and 1 swing mode) 2) How to set 3D auto operation 3) RC has 5 Vertical Up/Down Swings where as MHI-Ac-Ctrl seems to support only 4 4) Silent Operation of outdoor unit 5) Eco Mode/Powerful Mode 6) how to read Humidity sensor value in indoor unit 7) whats the difference between troom & return-air values. Why am i getting err_msg_invalid_signature and err_msg_invalid_checksum image

Following data is available image

absalom-muc commented 2 years ago

I have successfully connected to my Indian Version (high efficiency 5.7 ISEER unit) to mhi-ac-ctrl 2.04. latest version with 2.2 has errors when ac isnt connected to the cns connector. crashes with exception in the mhi core loop(), found out that the changes from 2.04 to 2.2 have caused the issue.

Could be resolved by v2.3

some enhancements to make:

1. how to control the Horizontal Left/Right Vanes(7 modes and 1 swing mode)

2. How to set 3D auto operation

3. RC has 5 Vertical Up/Down Swings where as MHI-Ac-Ctrl seems to support only 4

4. Silent Operation of outdoor unit

5. Eco Mode/Powerful Mode

All functionality supported by SPI and known by me is supported. Unfortunately not all functions supported by the infrared RC are supported by SPI. If you are aware that more functionality is supported on the SPI please provide the SPI code.

6. how to read Humidity sensor value in indoor unit

There is no humidity sensor in my indoor unit, so I don't how to read it out

7. whats the difference between troom & return-air values.

I don't know

   Why am i getting err_msg_invalid_signature and err_msg_invalid_checksum
   ![image](https://user-images.githubusercontent.com/24961429/139592052-76a4dcc6-8286-4299-b4e7-5cdacf841191.png)

Following data is available image

Maybe the cable between AC and MHI-AC-Ctrl PCB is too long? If this is not the case I don't know the answer and I would not spend too much time in it when it is working most of the time

kARTechnology commented 2 years ago

@absalom-muc Thanks for the reply

I've been using 2.3 only. looks like the "releases" section has only 2.2 and in 2.2 only i had got the exceptions . How do i help to provide the SPI code, is there any way to capture the data when i use RC and have this mhi-ac-ctrl connected?

cable length is like around 10 to 15cm. good quality one, tried re flashing with 160mhz and little better than before.

i see the refresh rate of data values is pretty slow, like the outdoor COMP frequency measurement is sent like every few minutes. is there any way to get Realtime data like every 5 seconds of all parameters...

absalom-muc commented 2 years ago

@absalom-muc Thanks for the reply

I've been using 2.3 only. looks like the "releases" section has only 2.2 and in 2.2 only i had got the exceptions . How do i help to provide the SPI code, is there any way to capture the data when i use RC and have this mhi-ac-ctrl connected?

I'm using a second MHI-AC-Ctrl PCB in Spy mode (listening only). The raw data are analyzed with a c# program. But currently I don't want to publish this SW.

cable length is like around 10 to 15cm. good quality one, tried re flashing with 160mhz and little better than before.

maybe it is because SCK frequency is higher than expected (usually 3200Hz).

i see the refresh rate of data values is pretty slow, like the outdoor COMP frequency measurement is sent like every few minutes. is there any way to get Realtime data like every 5 seconds of all parameters...

You can increase the read out frequency by reducing the number of selected data in opdata. You could try to reduce the NoFramesPerPacket, you have to test the minimum number. Finally the read out frequency could be limited by how often the AC provides updated data.

kARTechnology commented 2 years ago

Fiddling with the noframes(currently at 8) and commenting out many parameters of the opdata, now having only returnair, outdoor temp, iu and ou fanspeed, comp freq, ct and protection, spi errors occurrence is greatly reduced. whats the min. no. frames/packet

I would like to help you get the raw data for the 3d auto, r/r vanes, silent outdoor/eco/powerful/selfclean mode, and the missing u/d vane.

I can also connect my laptop to the esp while its connected to the ac.

also added web based firmware update, and http server to change ac settings by get requests, and influxdbv1 integration to graph out the data in real time.. is there any variable to get the current status of ac like temp, power,fan and mode...to display in webpage.. also was able to connect with google assistant by webhooks. changes made for influxdb if anyone looking for it.



Point ponit_mhiac("mhi_status");

void output_P(const ACStatus status, PGM_P topic, PGM_P payload) {
  const int mqtt_topic_size = 100;
  char mqtt_topic[mqtt_topic_size];

  Serial.printf_P(PSTR("status=%i topic=%s payload=%s\n"), status, topic, payload);

  if ((status & 0xc0) == type_status)
    strncpy_P(mqtt_topic, PSTR(MQTT_PREFIX), mqtt_topic_size);
  else if ((status & 0xc0) == type_opdata)
    strncpy_P(mqtt_topic, PSTR(MQTT_OP_PREFIX), mqtt_topic_size);
  else if ((status & 0xc0) == type_erropdata)
    strncpy_P(mqtt_topic, PSTR(MQTT_ERR_OP_PREFIX), mqtt_topic_size);
  strncat_P(mqtt_topic, topic, mqtt_topic_size - strlen(mqtt_topic));

  MQTTclient.publish_P(mqtt_topic, payload, true);

 if (isnan(String(payload)[0]))
    ponit_mhiac.addField(String(mqtt_topic), String( payload));
  else
  {
    String dat = String(payload);
    ponit_mhiac.addField(String(mqtt_topic), dat.toFloat());
  } 
  if (!iclient->writePoint(ponit_mhiac))     Serial.print(F("InfluxDB write failed: ")); 
  ponit_mhiac.clearFields(); 

}```
absalom-muc commented 2 years ago

Fiddling with the noframes(currently at 8) and commenting out many parameters of the opdata, now having only returnair, outdoor temp, iu and ou fanspeed, comp freq, ct and protection, spi errors occurrence is greatly reduced

That is interesting, I was not aware of this effect.

kARTechnology commented 2 years ago

Leaving 3D auto on on the remote control, subsequent commands from mhi-ac-ctrl doesnt change the state. Could you please help me provide u raw data to analyze?

kARTechnology commented 2 years ago

After a SELF CLEAN operation by remote. mhi-ac-ctrl for turning on/off the ac doesnt work unless the unit is again turned on / off without self clean.

absalom-muc commented 2 years ago

Leaving 3D auto on on the remote control, subsequent commands from mhi-ac-ctrl doesnt change the state. Could you please help me provide u raw data to analyze?

I plan providing the program for recording the SPI traces in the next weeks. Based on these traces and SPI.md you could try to analyze it (maybe also related to the SELF CLEAN issue you mentioned before).

kARTechnology commented 2 years ago

Leaving 3D auto on on the remote control, subsequent commands from mhi-ac-ctrl doesnt change the state. Could you please help me provide u raw data to analyze?

I plan providing the program for recording the SPI traces in the next weeks. Based on these traces and SPI.md you could try to analyze it (maybe also related to the SELF CLEAN issue you mentioned before).

thanks, would be happy to help, i plan to keep this unit for the next 15 years IMG_20211205_210953 .

Things to trace: 1) Self Clean 2) Eco mode/Powerful mode 3) L/R swing and 5 step U/D swing and 3D auto 4) Outdoor Silent Mode

PietNL commented 2 years ago

Hi! I suspect that at the swing and 3d auto modes should be possible if I look at the following 2 guides for the wifi module from MHI. Installation manual: https://www.mhi-mth.co.jp/en/products/pdf/rkz012a105a_english.pdf App manual: https://www.mhi-mth.co.jp/en/products/pdf/rkz012a107c_english.pdf

This module connects to the same CNS port on our devices so it should be possible to offer the same functionality or am I seeing this wrong? :)

damienmorrissey commented 2 years ago

Makes sense. If we had a wifi module we would probably be better off. Do we know of someone who has a wifi module?

On Wed, 8 Dec 2021, 17:38 PietNL, @.***> wrote:

Hi! I suspect that at the eco/power swing and 3d auto modes should be possible if I look at the following 2 guides for the wifi module from MHI. Installation manual: https://www.mhi-mth.co.jp/en/products/pdf/rkz012a105a_english.pdf App manual: https://www.mhi-mth.co.jp/en/products/pdf/rkz012a107c_english.pdf

This module connects to the same CNS port on our devices so it should be possible to offer the same functionality or am I seeing this wrong? :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/absalom-muc/MHI-AC-Ctrl/issues/73#issuecomment-988541249, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANALEHJCR3POJBCGLOHFOJLUP34P7ANCNFSM5HCOFD4Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

PietNL commented 2 years ago

Hmmh, just found this Repo: https://github.com/TheZeroBeast/ACWiFi, for me (not a developer) it looks like the 3dauto function is included in that code?

damienmorrissey commented 2 years ago

Certainly looks like it...

On Wed, 8 Dec 2021, 19:12 PietNL, @.***> wrote:

Hmmh, just found this Repo: https://github.com/TheZeroBeast/ACWiFi, for me (not a developer) it looks like the 3dauto function is included in that code?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/absalom-muc/MHI-AC-Ctrl/issues/73#issuecomment-988589979, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANALEHLJQSKOSGRIFYDDDPDUP4HQNANCNFSM5HCOFD4Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kARTechnology commented 2 years ago

Hmmh, just found this Repo: https://github.com/TheZeroBeast/ACWiFi, for me (not a developer) it looks like the 3dauto function is included in that code?

looks like ir code for 3d auto and not by cns?

absalom-muc commented 2 years ago

Leaving 3D auto on on the remote control, subsequent commands from mhi-ac-ctrl doesnt change the state. Could you please help me provide u raw data to analyze?

I plan providing the program for recording the SPI traces in the next weeks. Based on these traces and SPI.md you could try to analyze it (maybe also related to the SELF CLEAN issue you mentioned before).

Please have a look on MHI-AC-Trace

kARTechnology commented 2 years ago

Leaving 3D auto on on the remote control, subsequent commands from mhi-ac-ctrl doesnt change the state. Could you please help me provide u raw data to analyze?

I plan providing the program for recording the SPI traces in the next weeks. Based on these traces and SPI.md you could try to analyze it (maybe also related to the SELF CLEAN issue you mentioned before).

Please have a look on MHI-AC-Trace

image

OTA doesnt work. looks like with valid packet only OTAhandle is called are 2 esp8266 needed? I flashed this on the existing one connected to ac

absalom-muc commented 2 years ago

Just tried it, OTA works. But the PCB must be connected to the AC, at least SCK must be connected. One esp8266 is sufficient. I suggest you close the issue here, and open a new one in MHI-AC-Trace if needed.

absalom-muc commented 2 years ago

Your AC is one of the few with a different MOSI signature. 6d 80 04 instead of 6c 80 04. I adapted the SW, it should work now. Please also consider the new option MQTT_CHAR in support.h.