georgezhao2010 / midea_ac_lan

Auto-configure and then control your Midea M-Smart devices (Air conditioner, Fan, Water heater, Washer, etc) via local area network.
MIT License
1.37k stars 231 forks source link

Freeze Protection missing #141

Open dscowan opened 1 year ago

dscowan commented 1 year ago

Is there any way to set the heat pump units to freeze protection. I can do it via remote by clicking twice on the down temperature once at the bottom temperature, but I don't see a control for it in the integration

flyoffacliff commented 1 year ago

Duplicate: https://github.com/georgezhao2010/midea_ac_lan/issues/112

I would love this feature. I know the ESPhome integration has it, and I think there was a fork or branch somewhere where someone ported it to this integration. But I am too stupid to get it working in Home Assistant without HACS.

flyoffacliff commented 1 year ago

Looking through the code, device.py and mesage.py have items for frost protect, but it's not fully implemented for some reason.

Rmh1978 commented 1 year ago

Yes correct. It seems like most of the code is implemented for version 0.3.17 I copied the 3 files that has codes for frost_protect + PRESET_AWAY to my integration.

custom_components/midea_ac_lan/climate.py custom_components/midea_ac_lan/midea/devices/ac/device.py custom_components/midea_ac_lan/midea/devices/ac/message.py

I can get my system to change to the preset mode = PRESET_SLEEP / sleep_mode. But when i try to set preset = PRESET_AWAY / frost_protect Then the AC beeps but it does not change to FP.

I suspect the code for my AC for FP is not "frost_protect". Maybe something like "frost_protect_mode" but thats just a guess.

Rmh1978 commented 1 year ago

@georgezhao2010 maybe you can point me in the dirrection where to look? :-)

Rmh1978 commented 1 year ago

I just tested by setting the AC in FP.

In the Climate enitity it does show FP preset_mode: none frost_protect: false

When i set AC to sleep mode it shows correct preset_mode: sleep sleep_mode true

So the implemented code will probertly not work

georgezhao2010 commented 1 year ago

Anyone can tell me the model of device that spports freeze protection mode? It can be found in Settings -> Devices & Services -> Midea AC LAN -> Devices -> Device Info.

Rmh1978 commented 1 year ago

I have Qlima AC that supports freeze protection.

I use Smart home to control it, but it does not have: Settings -> Devices & Services -> Midea AC LAN -> Devices -> Device Info.

What app do you use to see that?

georgezhao2010 commented 1 year ago

I have Qlima AC that supports freeze protection.

I use Smart home to control it, but it does not have: Settings -> Devices & Services -> Midea AC LAN -> Devices -> Device Info.

What app do you use to see that?

”Settings -> Devices & Services -> Midea AC LAN -> Devices -> Device Info.“ in Home Assistant.

Rmh1978 commented 1 year ago

Ahh right :-)

Air Conditioner 00000Q13 by Midea

georgezhao2010 commented 1 year ago

Ahh right :-)

Air Conditioner 00000Q13 by Midea

OK,thank you, I'll take a look for this.

georgezhao2010 commented 1 year ago

Ahh right :-)

Air Conditioner 00000Q13 by Midea

Could you enable the debug log, then turn on/off the freeze protection by the App and show the logs to me?

Rmh1978 commented 1 year ago

I made a debug report where i

This is the log. But it seems like it does not record the sending.

`2023-09-30 11:08:56.830 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c00188667f7f00000000005a54000000000000a5', 'message type': '03', 'body type': 'c0'}

2023-09-30 11:08:56.831 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': True, 'mode': 4, 'target_temperature': 24.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 20.0, 'outdoor_temperature': 17.0} `

This is a log where i tuned on the AC, set temp, toggled FP, AC off.

`2023-09-30 11:01:48.603 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff03ff000200000000000000000000000096e3', 'message type': '03', 'body type': '41'}

2023-09-30 11:01:49.088 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c0018e507f7f00000000005a53000000000000b6', 'message type': '03', 'body type': 'c0'}

2023-09-30 11:01:49.089 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': True, 'mode': 4, 'target_temperature': 30.0, 'fan_speed': 80, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 20.0, 'outdoor_temperature': 16.0}

2023-09-30 11:02:19.144 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff03ff000200000000000000000000000099a2', 'message type': '03', 'body type': '41'}

2023-09-30 11:02:19.630 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c00189667f7f00000000005a53000000000000a5', 'message type': '03', 'body type': 'c0'}

2023-09-30 11:02:19.631 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': True, 'mode': 4, 'target_temperature': 25.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 20.0, 'outdoor_temperature': 16.0}

2023-09-30 11:02:49.691 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff03ff00020000000000000000000000009c9d', 'message type': '03', 'body type': '41'}

2023-09-30 11:02:50.174 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c00088667f7f00000000005a53000000000000a7', 'message type': '03', 'body type': 'c0'}

2023-09-30 11:02:50.175 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': False, 'mode': 4, 'target_temperature': 24.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': False, 'full_dust': False, 'indoor_temperature': 20.0, 'outdoor_temperature': 16.0, 'indirect_wind': False} `

FP gets actived on the remote volume button hold for 3 seconds. The midea Home smart app can´t active FP.

georgezhao2010 commented 1 year ago

I made a debug report where i

  • Turned on debug
  • Turned on FP
  • Turned off FP
  • Turned off debug

Thank you for your cooperation.

georgezhao2010 commented 1 year ago

I made a debug report where i

  • Turned on debug
  • Turned on FP
  • Turned off FP
  • Turned off debug

The logs seem odd. Are these all the logs?

The freeze protection is called ‘degree8_heat’ in the LUA script of the device, It is located at the 21st byte (base 0) of the message body.

if(#binData >= 23) then
    KeyP["degree8_heat"] = bit.rshift(bit.band(messageBytes[21], 0x80),7)
end

But the length of the message body in the logs is only 20 bytes.

'header': 'aa1eac00000000000003', 'body': 'c00088667f7f00000000005a53000000000000a7'

So, the message does not actually contain any freeze protection content.

Rmh1978 commented 1 year ago

Yes i would believe it is all the log. I turned on debug and turned it off again and then got a download with the log in txt. I removed all the older entries that where not debug and related to Midea.

Can i do something else to investegate the output?

georgezhao2010 commented 1 year ago

Yes i would believe it is all the log. I turned on debug and turned it off again and then got a download with the log in txt. I removed all the older entries that where not debug and related to Midea.

Can i do something else to investegate the output?

Could you turn the FP on in the App and wait 2 mins, then turn it off and wait 2 mins and stop the log? Then show the logs to me.

Rmh1978 commented 1 year ago

That helped with some more putput. The app can´t active FP. I can only do it with the physic remote.

2023-09-30 16:43:29.310 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff03ff00020000000000000000000000006697', 'message type': '03', 'body type': '41'}

2023-09-30 16:43:29.793 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c00188667f7f00000000005e54000000000000a1', 'message type': '03', 'body type': 'c0'}

2023-09-30 16:43:29.793 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': True, 'mode': 4, 'target_temperature': 24.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 22.0, 'outdoor_temperature': 17.0}

2023-09-30 16:43:59.840 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff03ff000200000000000000000000000069d6', 'message type': '03', 'body type': '41'}

2023-09-30 16:44:00.323 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c00188667f7f00000000005e54000000000000a1', 'message type': '03', 'body type': 'c0'}

2023-09-30 16:44:00.324 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': True, 'mode': 4, 'target_temperature': 24.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 22.0, 'outdoor_temperature': 17.0}

2023-09-30 16:44:30.375 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff03ff00020000000000000000000000006ce9', 'message type': '03', 'body type': '41'}

2023-09-30 16:44:30.856 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c00188667f7f00000000005e54000000000000a1', 'message type': '03', 'body type': 'c0'}

2023-09-30 16:44:30.857 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': True, 'mode': 4, 'target_temperature': 24.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 22.0, 'outdoor_temperature': 17.0}

2023-09-30 16:45:00.915 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff03ff00020000000000000000000000006f0b', 'message type': '03', 'body type': '41'}

2023-09-30 16:45:01.401 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c00188667f7f00000000005e55000000000000a0', 'message type': '03', 'body type': 'c0'}

2023-09-30 16:45:01.402 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': True, 'mode': 4, 'target_temperature': 24.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 22.0, 'outdoor_temperature': 17.0}

2023-09-30 16:45:31.450 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Sending: {'header': 'aa20ac00000000000003', 'body': '418100ff03ff0002000000000000000000000000726b', 'message type': '03', 'body type': '41'}

2023-09-30 16:45:31.936 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.devices.ac.device] [18691697873851] Received: {'header': 'aa1eac00000000000003', 'body': 'c00188667f7f00000000005e55000000000000a0', 'message type': '03', 'body type': 'c0'}

2023-09-30 16:45:31.937 DEBUG (Air Conditioner) [custom_components.midea_ac_lan.midea.core.device] [18691697873851] Status update: {'power': True, 'mode': 4, 'target_temperature': 24.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'smart_eye': False, 'dry': False, 'aux_heating': False, 'boost_mode': False, 'sleep_mode': False, 'frost_protect': False, 'comfort_mode': False, 'eco_mode': False, 'natural_wind': False, 'temp_fahrenheit': False, 'screen_display': True, 'full_dust': False, 'indoor_temperature': 22.0, 'outdoor_temperature': 17.0}

georgezhao2010 commented 1 year ago

The app can´t active FP. I can only do it with the physic remote.

First, thank you for your logs.

You said The app can´t active FP. I can only do it with the physic remote.

I think I know why I can’t find the FP info in the logs. The FP of your device doesn’t support control from the network, it just supports control from the IR remote.

The good news is that we don’t have to worry about this anymore, but the bad news is that you can’t control FP from HA.

Rmh1978 commented 1 year ago

Ohh, that bad :-(

Thank you for trying.

Is that all Midea ACs, or is it a feature in the firmware on more expensive ACs or maybe sloppy programming?

georgezhao2010 commented 1 year ago

Ohh, that bad :-(

Thank you for trying.

Is that all Midea ACs, or is it a feature in the firmware on more expensive ACs or maybe sloppy programming?

Theoretically, it should be controllable from the network in some ACs. The LUA script I posted has the functionality to read and control FP. I think maybe other models might support it?

Rmh1978 commented 1 year ago

I will try to write Qlima support and ask them to implement it.

I believe i have seen somewhere that the Midea app supports FP but its disabled because my AC dosent support it on the network.