mill1000 / midea-msmart

Python library for local control of Midea (and associated brands) smart air conditioners.
MIT License
49 stars 2 forks source link

Support for target temperature under 17 degrees celsius #77

Closed pauliborodulin closed 11 months ago

pauliborodulin commented 1 year ago

I have Midea Mission Pro 9, which is a model of Midea's AC imported and sold by Finnish distributor Onninen. If I set the temp to 16 degrees celsius using Midea Air App, the temp is incorrectly reported as 17 degrees by msmart-ng (version 2023.9.5):

INFO:msmart.cli:{'ip': '10.0.0.123', 'port': 6444, 'id': 0, 'online': True, 'supported': True, 'type': <DeviceType.AIR_CONDITIONER: 172>, 'name': None, 'sn': None, 'key': '[removed]', 'token': '[removed]', 'power': True, 'mode': <OperationalMode.HEAT: 4>, 'fan_speed': <FanSpeed.AUTO: 102>, 'swing_mode': <SwingMode.VERTICAL: 12>, 'target_temperature': 17.0, 'indoor_temperature': 20.0, 'outdoor_temperature': 11.5, 'eco': False, 'turbo': False, 'freeze_protection': False, 'sleep': False, 'display_on': True, 'beep': False, 'fahrenheit': False}

If I set the temp to 17 degrees or higher using Midea Air App, msmart-ng reports the temperature correctly. I am also unable to set the temp to 16 degrees using msmart-ac-py. The following warnings get logged when I attempt it:

hass | 2023-09-20 20:34:19.225 WARNING (MainThread) [msmart.device.AC.device] Device is not capable of operational mode 4. hass | 2023-09-20 20:34:19.231 WARNING (MainThread) [msmart.device.AC.device] Device is not capable of swing mode 12. hass | 2023-09-20 20:34:19.460 WARNING (MainThread) [msmart.device.AC.command] Unknown capability. ID: 0x 610, Size: 1.

This seems to be due to fact that older models could not go under 17 degrees. Later models support lower temperature setting, but require update to msmart's getTargetTemp and setTargetTemp. Such updates has already been done in MideaUART: https://github.com/dudanov/MideaUART/commit/3bbd505ee58792a620ad115f9f26652b688f58e3

pauliborodulin commented 1 year ago

I prepared a fix and created a PR: https://github.com/mill1000/midea-msmart/pull/78

mill1000 commented 1 year ago

Interestingly I have a device capable of 16 C with the current code, even though the references I've seen say that should be invalid