mill1000 / midea-ac-py

Home Assistant custom integration to control Midea (and associated brands) air conditioners via LAN.
MIT License
153 stars 17 forks source link

Toggle "Follow Me" from integration? #229

Closed CRCinAU closed 1 month ago

CRCinAU commented 2 months ago

I'm not sure if this is possible, but I notice that my unit has a "follow_me" mode. This toggles between a sensor in an unknown location (maybe intake vent?) and the thermostat in the wall controller.

In most cases, the temp sensor in the wall controller is probably the one I want to get readings from - and is active when follow_me: true is in the device attributes:

image

I get two sensors for temperature in the device: image

I believe the "Indoor" temperature probe is likely the one I don't know the location of - but nothing seems to return the wall control temperature.

Sometimes, it would be good to toggle the follow_me option from remote to change which sensor is in use. When turning it off on the wall controller, the attribute correctly changes to false.

That means its reading the value correctly, but it doesn't seem to be able to change this value?

On another related note, being able to get the temperature of the wall controller would be fantastic if this is possible. Currently, in HA I display a reading from my ZoneTouch 3 ducting controller which site just to the left of the wall control panel - and the readings between the "Indoor" sensor and the ZT3 makes me believe the sensors are in different locations.

mill1000 commented 2 months ago

The integration supports setting follow_me via a service/action call.

image

Some additional details in this PR: https://github.com/mill1000/midea-msmart/pull/91

It's an experimental feature and I've seen mixed success from users.

On another related note, being able to get the temperature of the wall controller would be fantastic if this is possible. Currently, in HA I display a reading from my ZoneTouch 3 ducting controller which site just to the left of the wall control panel - and the readings between the "Indoor" sensor and the ZT3 makes me believe the sensors are in different locations.

I can only report what the device sends me. I'm not currently aware of any other temperature sensors I can report. This is the first time I've heard of a wall controller for these devices.

CRCinAU commented 2 months ago

Interesting, thanks. I tried setting the following action without success: image

The attributes still show follow_me: true

For reference, this is my install: image

The unit is made by these guys: https://www.rinnai.com.au/online/air-conditioning/ducted-air-conditioners/ducted-reverse-cycle/

The Wifi module is a 'B064869 Smart Port WiFi OIM kit" Manual attached, because why not :D B064869 Smart Port WiFi OIM Issue 1 April 2019 V2 (2).pdf

Annoyingly, it comes with an IR remote control that the ONLY button that works is the button to set the Wifi module into pairing mode so you can connect it to wifi. It doesn't have any other operations or functions. Total waste of a remote control and IR receiver :laughing:

mill1000 commented 2 months ago

Can you enable debug logging and try the service again? Perhaps it's not setting the bit as I expect.

Is there any form of OEM app that can control this follow me mode for your unit, or is it solely based on the control panel?

CRCinAU commented 2 months ago

As requested:

2024-09-07 13:18:11.847 DEBUG (MainThread) [msmart.base_device] Sending command to 172.31.1.249:6444: aa21ac00000000000003418100ff03ff000200000000000000000000000003ca831b
2024-09-07 13:18:11.848 DEBUG (MainThread) [msmart.lan] Sending packet to 172.31.1.249:6444: 5a5a01116800200000000000540b1203070918146db307000089000000000000000000000000000065cd8728fc6a5d31e6464235e81fa3b30b7d1adca2c4d4cd1ba595d032b97b5f79ab27472366a3b8159e8b6704d997c59c03ac2c7541d3feaaeac549abf43dbc
2024-09-07 13:18:11.849 DEBUG (MainThread) [msmart.lan] Sending data to 172.31.1.249:6444: 8370008e206694f8b53c95ea3f76ea5aebd81a892e934742dd5b7e690132466b2a33c2521c727844edcd9aef12cf12a9b3b781e6dcf7472df32dc977a7a7609e93a412ea604c523f2e73d658761a9d918f6cce6b56fcb0cf9f5ffd258542a9786ed7f1a3702cce915c8624c2815d40bc23c5a95674b57f514d5cc441b95948624825c166b0ae146d2e00bebc06687ae9f68ccffb3ed3
2024-09-07 13:18:11.936 DEBUG (MainThread) [msmart.lan] Received data from 172.31.1.249:6444: 8370008e2063db2662fa8d132505abdce7898d0b44ab42e93e0336aed033c3e19671563a9c99038e720ff9ceb5aa7a64980aa601d611277d2efbca9c90000d0d29eec2e4be7c0d5c2c1d677caf3d2cc30fef2c25a7642073f92caf4d441ab56c5be293bda979969a3dc1240ce2b8a6be6cc8dcf65689f33ff768caf920622c786e5226a42608c6dd41eb0139994af49553bbcbf37074
2024-09-07 13:18:11.937 DEBUG (MainThread) [msmart.lan] Received packet from 172.31.1.249:6444: 5a5a0111680020800000000000000000000000006db3070000890000000000000000000000000000c7e33322591b889ef841d027e6d53b63a35257479efa1367694eb2c5c30f4d71719c8d6623206accd86c0d3d431fb9ff79a4d0d737214fc5a94e87c17935ea68
2024-09-07 13:18:11.938 DEBUG (MainThread) [msmart.lan] Received response from 172.31.1.249:6444: aa22ac00000000000303c001a6507f7f0030000000635f00000000000000000083b250
2024-09-07 13:18:11.938 DEBUG (MainThread) [msmart.base_device] Response from 172.31.1.249:6444 in 0.090000 seconds.
2024-09-07 13:18:11.938 DEBUG (MainThread) [msmart.device.AC.command] State response payload: c001a6507f7f0030000000635f00000000000000000083
2024-09-07 13:18:11.938 DEBUG (MainThread) [custom_components.midea_ac.coordinator] Finished fetching midea_ac data in 0.091 seconds (success: True)
2024-09-07 13:18:14.145 DEBUG (MainThread) [msmart.base_device] Sending command to 172.31.1.249:6444: aa24ac000000000000024003a6507f7f003000000000000000000000000000000000cb8775
2024-09-07 13:18:14.146 DEBUG (MainThread) [msmart.lan] Connection to 172.31.1.249:6444 has expired.
2024-09-07 13:18:14.146 DEBUG (MainThread) [msmart.lan] Disconnecting from 172.31.1.249:6444.
2024-09-07 13:18:14.146 INFO (MainThread) [msmart.lan] Creating new connection to 172.31.1.249:6444.
2024-09-07 13:18:14.155 DEBUG (MainThread) [msmart.lan] Connected to 172.31.1.249:6444.
2024-09-07 13:18:14.158 INFO (MainThread) [msmart.lan] Authenticating with 172.31.1.249:6444.
2024-09-07 13:18:14.158 DEBUG (MainThread) [msmart.lan] Sending data to 172.31.1.249:6444: 837000402000000018bf9c4cb6b1b5b44d7ca548cfb6efdb46d39e740b9d39ea71e1ff5589e1f9ba8f7dfd5bcd872a0961923ab282353a7bc6e1b99a02521a46ca605c05bb3eab0e
2024-09-07 13:18:14.188 DEBUG (MainThread) [msmart.lan] Received data from 172.31.1.249:6444: 83700040200100008f13ddc1332d5a1485bce9cb956f23435425f457021c389b7e3ae342e63f55e361c103010b9c1fedccb0a2e27417f362e192a1062b146c0ebf8e5b02be91650d
2024-09-07 13:18:14.189 INFO (MainThread) [msmart.lan] Authentication with 172.31.1.249:6444 successful. Expiration: 2024-09-07T15:18:14+00:00, Local key: 00a69cc7583c7c74ecbc1798b7b9d5d57423f593feb0f97a815014810966e57f
2024-09-07 13:18:15.190 DEBUG (MainThread) [msmart.lan] Sending packet to 172.31.1.249:6444: 5a5a01116800200000000000130f1203070918146db307000089000000000000000000000000000054cc3c3ea2c5c6f295152f6dbfbbf6f58b0164f204b60803fd1e0ea38206e81cc7b904c22dca512a96a2ec282e86aa58fdf00a394089aa993159243a0df490eb
2024-09-07 13:18:15.190 DEBUG (MainThread) [msmart.lan] Sending data to 172.31.1.249:6444: 8370008e20664ffdf9775a54a12f08384dc9fd2de16eb37f552a8dfb270f5caedfd08670e0ccdbf149b30541fa1359e7cd45786af141256a8ade8b5f3247b4abb5a77d255af6d2435857024f2ca9ec6f9339f00eee182809ea6498940a6b9c3ebc69ea7e865362f01bfbb1837000c9778213f42d522c44b5c1a7c1581a87431ca0178f51ac98b694e11281bd427d351134e96dc9fb61
2024-09-07 13:18:15.843 DEBUG (MainThread) [msmart.lan] Received data from 172.31.1.249:6444: 8370008e20638caaa750fcf3db0d7908cec8b91b7d223800f70131fd8f226529f47c88af0bfbfac6184757eb04960009cd4ddd2c8763d675cebc6a697d6c2fc49333b91f0bd0d492c5db7b715ea6bcc8511426bfc1c2b3b915cb1b4c6e75aa539ec76df25c46b4c0ff9fb98e5adb99fe9005c906dda7df47fad285f11e252bdd34d7df5e244672df4c793d9aae2d0c2f3e6ace8c222a
2024-09-07 13:18:15.844 DEBUG (MainThread) [msmart.lan] Received packet from 172.31.1.249:6444: 5a5a0111680020800000000000000000000000006db3070000890000000000000000000000000000b2551b9a1549e4db0a4adc890fcc8594a35257479efa1367694eb2c5c30f4d71592dbb88b3c7cf970a7e64cd2996ad783300c57bbc369ddedc21098aaa87e15a
2024-09-07 13:18:15.844 DEBUG (MainThread) [msmart.lan] Received response from 172.31.1.249:6444: aa22ac00000000000302c001a6507f7f0030000000635f00000000000000000000dcaa
2024-09-07 13:18:15.845 DEBUG (MainThread) [msmart.base_device] Response from 172.31.1.249:6444 in 1.700000 seconds.
2024-09-07 13:18:15.845 DEBUG (MainThread) [msmart.device.AC.command] State response payload: c001a6507f7f0030000000635f00000000000000000000
2024-09-07 13:18:15.845 DEBUG (MainThread) [msmart.base_device] Sending command to 172.31.1.249:6444: aa21ac00000000000003418100ff03ff000200000000000000000000000003cc5e3e
2024-09-07 13:18:15.850 DEBUG (MainThread) [msmart.lan] Sending packet to 172.31.1.249:6444: 5a5a01116800200000000000540f1203070918146db307000089000000000000000000000000000065cd8728fc6a5d31e6464235e81fa3b369f92e59c9a22c84d55711cfbdbcf74dcca640b70e6ea249061c9c01fa576d2e14c731ca9acc82b4e811a4e0fc52c41b
2024-09-07 13:18:15.850 DEBUG (MainThread) [msmart.lan] Sending data to 172.31.1.249:6444: 8370008e2066661f6b9a8a5190de4fb57cebe111270f3b681063d262c91a5912e10dec08668f1f1542f54db556bdb7c5f5d3704a00f961b337bd023c8ab2f4b485acb7ed429bab626f09fd3bd4db238f803c7b708b6f562f431d520a35b67fb68bda49ad2f7a2ae3faeff4b56e4ec5b0c6dfac140e31edb2cbcc529af89935f921b525761f93b9c273c95d5f4197dfdf752c3ad272be
2024-09-07 13:18:15.931 DEBUG (MainThread) [msmart.lan] Received data from 172.31.1.249:6444: 8370008e2063ae750be84a52c62894d4cd53697adc34ce8cc01e703db8d929b492d293bfa33ecc5d022d54d2988f8c36d39a22bc99d90fc1c0e0397e28b52cb881a1fa8202af3b7defc7c0b24367f09e7e4ce47ab6c16d54a173e8ac96cc241d7e61a299960405d0314be7da771e0a34a16163826dadded6eee1b494f90979a9249dfd1d303fa7072827a0ca438b68332ad4767ecb6f
2024-09-07 13:18:15.931 DEBUG (MainThread) [msmart.lan] Received packet from 172.31.1.249:6444: 5a5a0111680020800000000000000000000000006db3070000890000000000000000000000000000c7e33322591b889ef841d027e6d53b63a35257479efa1367694eb2c5c30f4d71ba1c567b9b91f9bed418a02634f2fd7f008787c8eafb4348e61dda4d04272ab4
2024-09-07 13:18:15.931 DEBUG (MainThread) [msmart.lan] Received response from 172.31.1.249:6444: aa22ac00000000000303c001a6507f7f0030000000635f0000000000000000005e180f
2024-09-07 13:18:15.931 DEBUG (MainThread) [msmart.base_device] Response from 172.31.1.249:6444 in 0.090000 seconds.
2024-09-07 13:18:15.932 DEBUG (MainThread) [msmart.device.AC.command] State response payload: c001a6507f7f0030000000635f0000000000000000005e
2024-09-07 13:18:15.932 DEBUG (MainThread) [custom_components.midea_ac.coordinator] Finished fetching midea_ac data in 0.086 seconds (success: True)
2024-09-07 13:18:16.934 DEBUG (MainThread) [msmart.base_device] Sending command to 172.31.1.249:6444: aa21ac00000000000003418100ff03ff000200000000000000000000000003cd009b
2024-09-07 13:18:16.935 DEBUG (MainThread) [msmart.lan] Sending packet to 172.31.1.249:6444: 5a5a011168002000000000005d101203070918146db307000089000000000000000000000000000065cd8728fc6a5d31e6464235e81fa3b3c4af172d627dc261b35011770d101306985367d7041250269ca4cb48f887e5028df87e20f35d998cbcbb179f70835888
2024-09-07 13:18:16.936 DEBUG (MainThread) [msmart.lan] Sending data to 172.31.1.249:6444: 8370008e2066f1134ce972f0d568141dc2fa80ebe4f9c0678d70a7c0c7f6ce9e7b14c6a58933f8373d7d9a8d2158732eb9f7e7e7bc5bb37fac67ba487206b513e1dbabdd8842d341d81bfd66773beb2cba31b80461f86ac32845ee6dfaf282382cde52dfd430ce7a0398e4be1d38f7611f332b5b099f1158b049152e89e3ef351713f8b221410c0757ef90e0b91dd7c3fb149d373a2e
2024-09-07 13:18:17.017 DEBUG (MainThread) [msmart.lan] Received data from 172.31.1.249:6444: 8370008e206343c82da7d553693775124b3adb46dc47944c825787a7a2f4d22051ee63e63ea9b02b92c5f3ac1a3eec67f3cf3bc21785021e6cd104d84f883ba3661760fd333c7f2194df4b2ad9805cd0f9c9bca46d17a68fbff47fb64a3a2ce19309cc22b17d18c9f24d790191beb669d853ee49ad9c67a58f1b96fbe783300478718d6dbe2a0b799bf3f8eb2d63310dedbb8a30807f
2024-09-07 13:18:17.018 DEBUG (MainThread) [msmart.lan] Received packet from 172.31.1.249:6444: 5a5a0111680020800000000000000000000000006db3070000890000000000000000000000000000c7e33322591b889ef841d027e6d53b63a35257479efa1367694eb2c5c30f4d71586706a0f9c65ab1a68da1a9977f8e96c78a5ed7f81acbc8595cdf756a232095
2024-09-07 13:18:17.019 DEBUG (MainThread) [msmart.lan] Received response from 172.31.1.249:6444: aa22ac00000000000303c001a6507f7f0030000000635f00000000000000000000dca9
2024-09-07 13:18:17.019 DEBUG (MainThread) [msmart.base_device] Response from 172.31.1.249:6444 in 0.080000 seconds.
2024-09-07 13:18:17.019 DEBUG (MainThread) [msmart.device.AC.command] State response payload: c001a6507f7f0030000000635f00000000000000000000
2024-09-07 13:18:17.019 DEBUG (MainThread) [custom_components.midea_ac.coordinator] Finished fetching midea_ac data in 0.086 seconds (success: True)

In the manual, they use Nethome Plus app. It just gives me the presets Boost and Sleep Curve - which you already have support for (and I really have to figure out what they actually do one day)...

I don't see anything about changing the Follow Me mode...

CRCinAU commented 2 months ago

This is the app page for the sleep curve...

Screenshot_20240907-133040

I did manage to break something here though:

2024-09-07 13:38:00.174 ERROR (MainThread) [msmart.base_device] Network error 172.31.1.249:6444: Unsupported packet: 8d6758a8c4cb12b00c89954c1eb2b1be9bbcdc905fb468fa43068123c11c2ff86498dbd789916dbe29ce94cf62951c373163c96d56304aff85dd737e7943d8a1
2024-09-07 13:38:14.849 ERROR (MainThread) [msmart.base_device] Network error 172.31.1.249:6444: Unsupported packet: ea5ccd837e88f3277f3855424a88fd5ce718c4c055b39d01aa1b45e98a3ae30cff23763b25235c20a606af032b43b8ec00cd8fe8f724d6d3ef3a20dd2fc26b1a
mill1000 commented 1 month ago

If I'm reading the logs right, they all show follow_me as off. Did the attribute say otherwise?

Maybe a good test would be to collect logs for the following. A. Turn follow_me On then Off at the control panel. Wait 20 seconds between changes. C. Use the service to set follow_me On, then again to set Off.

Re: Sleep curve. The integration supports the sleep preset, not sure how/if that's related to sleep curve or not

CRCinAU commented 1 month ago

To start with, Follow Me was ON from the control panel. I turned it off at the control panel, waited ~20 seconds, then turned it back on again.

Log attached: home-assistant_midea_ac_2024-09-12T06-28-49.160Z.log

CRCinAU commented 1 month ago

Second log, started with Follow Me turned ON at the control panel... Called the action to turn it OFF... Wait ~20 seconds... Call the action to turn it back ON...

Log attached: home-assistant_midea_ac_2024-09-12T06-33-09.411Z.log

mill1000 commented 1 month ago

Ok, those logs all agree with what you've stated before. The control panel toggles follow_me on and off, but the WiFi command is ignored.

So how does the control panel connect to the AC unit? Is it wireless? Directly wired?

CRCinAU commented 1 month ago

So, there's two modules I guess.... One is the module that adds wifi - which is what I'm using with this integration.

The other is the square one on the left side of the picture above. If I remember correctly, part of installing the 'wifi module' means disconnecting the wall wired panel, then hooking it to the wifi controller. The wifi controller then connects to the mainboard in the main unit in the roof. I'm guessing its some kind of RS422 or similar over the actual cable - and both just talk over the same bus.

I might be wrong on the RS422 bit - but information is pretty scarce about it...

EDIT: I actually wonder if there is an 'id' associated with the different modules - and the follow me is ignored because its from a module that doesn't have a temperature sensor - therefor it can't use the temp sensor in the wifi module.

Is there much in the way of documentation for the protocol?

mill1000 commented 1 month ago

I might be wrong on the RS422 bit - but information is pretty scarce about it...

Is there much in the way of documentation for the protocol?

Nothing official. Typically there's a UART interface between the WiFi module and AC device. The signalling has been TTL in the units I've tested but there's no reason it couldn't be RS232, RS422 or RS485.

The LAN protocol is a thin wrapper around the UART protocol that provides some encryption and authentication. The WiFi module receives packets, decodes and extracts a payload and forwards it over UART.

A worthwhile reference https://github.com/dudanov/MideaUART

LotharWoman commented 1 month ago

Hello, I think in this case it is the same cause as with my system, a VIVAX R Design ACP-12CH35AERI+. With this system, follow_me cannot be activated via app (NetHome Plus), but only via IR remote control. The status of the attribute "follow_me = false" does not change. The status cannot be changed to "true" using the actions in the developer options either. The AC acknowledges the change with "Peep", but cannot do anything with the command sent.

The reason behind this is actually quite simple with my system. "follow_me" is not switched in the AC indoor unit. The indoor unit constantly listens to whether an external temperature sensor is sending signals. If this is the case, it automatically uses it instead of using the built-in temperature sensor. The button on the remote control only activates/deactivates the temperature sensor in the remote control and the integration has no influence on this.

In the case of the wall sensor here, it will probably be comparable. If it is "active" then it is used preferentially. If the system no longer receives signals from the wall sensor, it automatically uses the integrated sensor again. Summary: If "follow_me" cannot be activated/deactivated via the app, the integration has no way of having an influence.

CRCinAU commented 1 month ago

Summary: If "follow_me" cannot be activated/deactivated via the app, the integration has no way of having an influence.

I think this may well be the case - being that the integration will be able to REPORT the value, but not SET the value.

I'll close this off - as if the only capability is REPORT, that's fine - its a system limitation and can't be worked around.