midea_ac_lan icon indicating copy to clipboard operation
midea_ac_lan copied to clipboard

Trying to troubleshoot unit unavailable and then immediately available issue in my logs

Open mattlward opened this issue 2 years ago • 20 comments

I have added the debug command to my configuration.yaml and when I attempt to reboot I get the following error and the system will not reboot.

I think it is the old version not being found, after yours worked I uninstalled the previous Midea HACS integration and have not restarted since.

Configuration.yaml entry:

logger:
  default: warning
  logs:
     custom_components.midea_ac_lan: debug

climate:
  - platform: midea_ac
    host: 192.168.1.xxx
    id: 12094627960xxx
Logger: homeassistant.components.hassio
Source: components/hassio/__init__.py:694
Integration: Home Assistant Supervisor (documentation, issues)
First occurred: 11:50:30 AM (3 occurrences)
Last logged: 11:53:22 AM

The system cannot restart because the configuration is not valid: Platform error climate.midea_ac - Integration 'midea_ac' not found.

Error in integration: image

mattlward avatar Aug 14 '22 17:08 mattlward

I have added the debug command to my configuration.yaml and when I attempt to reboot I get the following error and the system will not reboot.

I think it is the old version not being found, after yours worked I uninstalled the previous Midea HACS integration and have not restarted since.

Configuration.yaml entry:

...

remove the following from your configuration.yaml

climate:
  - platform: midea_ac
    host: 192.168.1.xxx
    id: 12094627960xxx

then restart the HA. then show the logs

georgezhao2010 avatar Aug 14 '22 17:08 georgezhao2010

Yeah, just did that... It was the cruff hanging around! Gathering logs now.

mattlward avatar Aug 14 '22 17:08 mattlward

BTW, your integration stopped a serious memory leak my system has had for years! Thanks!

It almost appears that removing the cruff may have solved the issue, but I will give it a few hours to be sure.

mattlward avatar Aug 14 '22 17:08 mattlward

Yeah, just did that... It was the cruff hanging around! Gathering logs now.

If the device disconnected from HA, It's marked as unavailable, the cause is usually a poor Wifi network. You can try ping the device from HA host to check the network.

georgezhao2010 avatar Aug 14 '22 17:08 georgezhao2010

BTW, your integration stopped a serious memory leak my system has had for years! Thanks!

It almost appears that removing the cruff may have solved the issue, but I will give it a few hours to be sure.

Really? I have no idea about this.

georgezhao2010 avatar Aug 14 '22 17:08 georgezhao2010

Looks like I caught the behavior at 12:39:

2022-08-14 12:24:26.862 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c12101c40000000000000000000000000000000000002dd5', 'message type': '03', 'body type': 'c1'}
2022-08-14 12:24:26.863 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': True}
2022-08-14 12:25:27.948 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa20ac8c000000000003', 'body': '418100ff03ff00020000000000000000000000000a51', 'message type': '03', 'body type': '41'}
2022-08-14 12:25:27.950 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa11acbd000000000003', 'body': '41210144000109', 'message type': '03', 'body type': '41'}
2022-08-14 12:25:35.590 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c00126660000003000100465ff200000000000000000853c', 'message type': '03', 'body type': 'c0'}
2022-08-14 12:25:35.590 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'power': True, 'mode': 1, 'target_temperature': 22.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'boost_mode': False, 'smart_eye': False, 'dry': False, 'eco_mode': True, 'aux_heat': False, 'sleep_mode': False, 'night_light': False, 'natural_wind': False, 'temp_fahrenheit': True, 'screen_display': True, 'comfort_mode': False, 'indoor_temperature': 25.0, 'outdoor_temperature': 0.0, 'available': True}
2022-08-14 12:25:35.673 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c12101c400000000000000000000000000000000000085b8', 'message type': '03', 'body type': 'c1'}
2022-08-14 12:25:35.673 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': True}
config $ tail home-assistant.log | grep Kitchen
2022-08-14 12:38:57.657 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Authentication success
2022-08-14 12:38:57.658 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa20ac8c000000000003', 'body': '418100ff03ff000200000000000000000000000031cf', 'message type': '03', 'body type': '41'}
2022-08-14 12:39:05.535 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c0012666000000300010045eff200000000000000000e0d6', 'message type': '03', 'body type': 'c0'}
2022-08-14 12:39:05.535 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'power': True, 'mode': 1, 'target_temperature': 22.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'boost_mode': False, 'smart_eye': False, 'dry': False, 'eco_mode': True, 'aux_heat': False, 'sleep_mode': False, 'night_light': False, 'natural_wind': False, 'temp_fahrenheit': True, 'screen_display': True, 'comfort_mode': False, 'indoor_temperature': 22.0, 'outdoor_temperature': 0.0, 'available': True}
2022-08-14 12:39:05.536 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa14acb8000000000003', 'body': 'b1034200180015003299', 'message type': '03', 'body type': 'b1'}
2022-08-14 12:39:15.550 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Does not supports the protocol MessageNewProtocolQuery, ignored
2022-08-14 12:39:15.550 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa11acbd000000000003', 'body': '41210144000109', 'message type': '03', 'body type': '41'}
2022-08-14 12:39:15.804 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c12101c4000000000000000000000000000000000000e0e2', 'message type': '03', 'body type': 'c1'}
2022-08-14 12:39:15.804 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': True}
2022-08-14 12:39:15.805 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': True}

Looks like the fault:

2022-08-14 12:39:15.550 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Does not supports the protocol MessageNewProtocolQuery, ignored

Unit model: Air Conditioner 00Q1F

mattlward avatar Aug 14 '22 17:08 mattlward

2022-08-14 12:39:15.550 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Does not supports the protocol MessageNewProtocolQuery, ignored

It's not a warning or an error or fault something and it won't make your device unavailable.

georgezhao2010 avatar Aug 14 '22 17:08 georgezhao2010

BTW, your integration stopped a serious memory leak my system has had for years! Thanks! It almost appears that removing the cruff may have solved the issue, but I will give it a few hours to be sure.

Really? I have no idea about this.

My memory free has gone up by about 500k just changing to this integration and the gentle consumption of memory has stopped!

mattlward avatar Aug 14 '22 17:08 mattlward

Ok... caught this.

2022-08-14 12:45:28.137 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c12101c4000000000000000000000000000000000000122a', 'message type': '03', 'body type': 'c1'}
2022-08-14 12:45:28.137 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': True}
2022-08-14 12:46:28.919 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa20ac8c000000000003', 'body': '418100ff03ff000200000000000000000000000046b4', 'message type': '03', 'body type': '41'}
2022-08-14 12:46:28.920 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa11acbd000000000003', 'body': '41210144000109', 'message type': '03', 'body type': '41'}
2022-08-14 12:46:29.512 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c0012666000000300010045cff200000000000000000e6db', 'message type': '03', 'body type': 'c0'}
2022-08-14 12:46:29.513 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'power': True, 'mode': 1, 'target_temperature': 22.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'boost_mode': False, 'smart_eye': False, 'dry': False, 'eco_mode': True, 'aux_heat': False, 'sleep_mode': False, 'night_light': False, 'natural_wind': False, 'temp_fahrenheit': True, 'screen_display': True, 'comfort_mode': False, 'indoor_temperature': 21.0, 'outdoor_temperature': 0.0, 'available': True}
2022-08-14 12:46:54.042 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Socket error Connection closed, reconnecting
2022-08-14 12:46:54.043 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': False}
2022-08-14 12:46:54.132 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Connected
2022-08-14 12:46:54.132 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Authentication success
2022-08-14 12:46:54.132 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa20ac8c000000000003', 'body': '418100ff03ff000200000000000000000000000049f5', 'message type': '03', 'body type': '41'}
2022-08-14 12:46:56.977 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c0012666000000300010045cff200000000000000000a2fc', 'message type': '03', 'body type': 'c0'}
2022-08-14 12:46:56.977 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'power': True, 'mode': 1, 'target_temperature': 22.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'boost_mode': False, 'smart_eye': False, 'dry': False, 'eco_mode': True, 'aux_heat': False, 'sleep_mode': False, 'night_light': False, 'natural_wind': False, 'temp_fahrenheit': True, 'screen_display': True, 'comfort_mode': False, 'indoor_temperature': 21.0, 'outdoor_temperature': 0.0, 'available': True}
2022-08-14 12:46:56.978 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa14acb8000000000003', 'body': 'b1034200180015004aa3', 'message type': '03', 'body type': 'b1'}
2022-08-14 12:47:06.991 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Does not supports the protocol MessageNewProtocolQuery, ignored
2022-08-14 12:47:06.991 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa11acbd000000000003', 'body': '41210144000109', 'message type': '03', 'body type': '41'}
2022-08-14 12:47:07.269 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c12101c4000000000000000000000000000000000000a218', 'message type': '03', 'body type': 'c1'}
2022-08-14 12:47:07.269 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': True}
2022-08-14 12:47:07.270 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': True}
2022-08-14 12:48:07.738 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa20ac8c000000000003', 'body': '418100ff03ff00020000000000000000000000004cca', 'message type': '03', 'body type': '41'}
2022-08-14 12:48:07.739 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Sending: {'header': 'aa11acbd000000000003', 'body': '41210144000109', 'message type': '03', 'body type': '41'}
2022-08-14 12:48:08.110 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c0012666000000300010045cff200000000000000000ca5b', 'message type': '03', 'body type': 'c0'}
2022-08-14 12:48:08.111 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'power': True, 'mode': 1, 'target_temperature': 22.0, 'fan_speed': 102, 'swing_vertical': False, 'swing_horizontal': False, 'boost_mode': False, 'smart_eye': False, 'dry': False, 'eco_mode': True, 'aux_heat': False, 'sleep_mode': False, 'night_light': False, 'natural_wind': False, 'temp_fahrenheit': True, 'screen_display': True, 'comfort_mode': False, 'indoor_temperature': 21.0, 'outdoor_temperature': 0.0, 'available': True}
2022-08-14 12:48:08.191 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.devices.ac.device] [12094627960958] Received: {'header': 'aa22ac00000000000303', 'body': 'c12101c4000000000000000000000000000000000000cabf', 'message type': '03', 'body type': 'c1'}
2022-08-14 12:48:08.192 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': True}

Key stuff:

2022-08-14 12:46:54.042 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Socket error Connection closed, reconnecting
2022-08-14 12:46:54.043 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Status update: {'available': False}
2022-08-14 12:46:54.132 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Connected
2022-08-14 12:46:54.132 DEBUG (Kitchen AC) [custom_components.midea_ac_lan.midea.core.device] [12094627960958] Authentication success

mattlward avatar Aug 14 '22 17:08 mattlward

Ok... caught this.

...

I told you, if the device disconnected from HA, It's marked as unavailable, the cause is usually a poor Wifi network. You can try ping the device from HA host to check the network.

ping [device ip address]

georgezhao2010 avatar Aug 14 '22 17:08 georgezhao2010

I understand the message... but this is a new problem with the integration. It does not seem to break anything, but logs stuff. BTW, my access point is and has been 15 feet away with no walls in between. I will add it to my smokeping instance.

mattlward avatar Aug 14 '22 17:08 mattlward

I was just standing and watching the unit, in eco/auto when it changed fan speed... it disconnected for a second. May be firmware on the unit? If I could update firmware, I would but I have never found updates for the unit. It seems that your software has maybe just made it more visible to me.

mattlward avatar Aug 14 '22 18:08 mattlward

I was just standing and watching the unit, in eco/auto when it changed fan speed... it disconnected for a second. May be firmware on the unit? If I could update firmware, I would but I have never found updates for the unit. It seems that your software has maybe just made it more visible to me.

Forget it if it does not break anything.

georgezhao2010 avatar Aug 14 '22 18:08 georgezhao2010

Likely what I will do... it makes the thermostat display on my card go unavailable for a second and then it reappears.

mattlward avatar Aug 14 '22 18:08 mattlward

Likely what I will do... it makes the thermostat display on my card go unavailable for a second and then it reappears.

Did you try to ping the device?

georgezhao2010 avatar Aug 14 '22 18:08 georgezhao2010

Likely what I will do... it makes the thermostat display on my card go unavailable for a second and then it reappears.

If it bothers you, you can modify the file midea_ac_lan/midea/core/device.py and remove the line 349 self.enable_device(False).

georgezhao2010 avatar Aug 14 '22 18:08 georgezhao2010

Will do, drives my ocd nuts. Can you tell me what that line does?

mattlward avatar Aug 14 '22 19:08 mattlward

Will do, drives my ocd nuts. Can you tell me what that line does?

That code sets your device to be unavailable immediately upon disconnection. After you delete that code, your device is set to unavailable only if re-connection fails.

georgezhao2010 avatar Aug 14 '22 20:08 georgezhao2010

Thanks, worked great! The other improvement you have made is to trim a substantial amount of time off of my reload.

mattlward avatar Aug 14 '22 21:08 mattlward

Thanks, worked great! The other improvement you have made is to trim a substantial amount of time off of my reload.

If there are no more problems, please close this issue.

georgezhao2010 avatar Aug 14 '22 21:08 georgezhao2010