wuwentao / 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
268 stars 12 forks source link

Device control broken in 0.4.2: update_state AttributeError #190

Closed Buniculbroscoi closed 1 month ago

Buniculbroscoi commented 3 months ago

HA core version

2024.6.4

Integration version

v0.4.2

Device type and model

Inventor Omnia eco

Used App

Msmarthome

The description of problem

Latest update broke all the controls of the AC from HA UI as well as homekit. Every action results in the error BrokenPipeError: [Errno 32] Broken pipe

Earlier today, before the update, everything was working flawlessly.

The logs

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2741, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 977, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1049, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 738, in async_handle_set_fan_mode_service await self.async_set_fan_mode(fan_mode) File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 746, in async_set_fan_mode await self.hass.async_add_executor_job(self.set_fan_mode, fan_mode) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/midea_ac_lan/climate.py", line 300, in set_fan_mode self._device.set_attribute(attr=ACAttributes.fan_speed, value=fan_speed) File "/usr/local/lib/python3.12/site-packages/midealocal/devices/ac/init.py", line 365, in set_attribute self.build_send(message) File "/usr/local/lib/python3.12/site-packages/midealocal/device.py", line 283, in build_send self.send_message(msg) File "/usr/local/lib/python3.12/site-packages/midealocal/device.py", line 254, in send_message self.send_message_v3(data, msg_type=MSGTYPE_ENCRYPTED_REQUEST) File "/usr/local/lib/python3.12/site-packages/midealocal/device.py", line 276, in send_message_v3 self.send_message_v2(data) File "/usr/local/lib/python3.12/site-packages/midealocal/device.py", line 261, in send_message_v2 self._socket.send(data) BrokenPipeError: [Errno 32] Broken pipe

Issues-translate-bot commented 3 months ago

Bot detected the issue body's language is not English, translate it automatically. πŸ‘―πŸ‘­πŸ»πŸ§‘β€πŸ€β€πŸ§‘πŸ‘«πŸ§‘πŸΏβ€πŸ€β€πŸ§‘πŸ»πŸ‘©πŸΎβ€πŸ€β€πŸ‘¨πŸΏπŸ‘¬πŸΏ


Title: Controls broken after latest update

chemelli74 commented 3 months ago

Hi @Buniculbroscoi, please downgrade to previous version of the component and confirm everything still works fine. Don't do any other change but only the downgrade and reboot.

Buniculbroscoi commented 3 months ago

Hi @Buniculbroscoi, please downgrade to previous version of the component and confirm everything still works fine. Don't do any other change but only the downgrade and reboot.

Hi @chemelli74, I did a restore a while ago to v0.4.1 and it works fine

chemelli74 commented 3 months ago

Hi @Buniculbroscoi, please downgrade to previous version of the component and confirm everything still works fine. Don't do any other change but only the downgrade and reboot.

Hi @chemelli74, I did a restore a while ago to v0.4.1 and it works fine

Please join HomeAssistant on Discord and then contact me: chemelli74#2180

I would like to carefully review the steps with you.

chemelli74 commented 3 months ago

Tested with @Buniculbroscoi and is confirmed that using HA 2024.6.4 and v0.4.1 works fine, while upgrading to v0.4.2 shows the above error.

Buniculbroscoi commented 3 months ago

2024-07-01 18:10:06.971 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration adaptive_lighting which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-07-01 18:10:06.971 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-07-01 18:10:06.972 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration midea_ac_lan which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-07-01 18:10:10.661 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues 2024-07-01 18:10:20.031 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 630: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues 2024-07-01 18:26:15.990 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.59, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:26:15.990 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.59, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:26:46.039 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.59, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:26:46.039 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.59, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:27:16.075 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.6, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:27:16.075 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.6, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:27:46.120 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.6, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:27:46.120 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.6, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:28:16.235 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.61, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:28:16.236 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.61, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:28:46.343 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.61, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:28:46.343 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.61, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:29:16.373 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.61, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:29:16.373 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.61, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:29:46.485 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.62, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:29:46.486 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.62, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:30:16.609 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_current_energy_consumption update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.62, 'current_energy_consumption': 0.0, 'realtime_power': 0.0} 2024-07-01 18:30:16.609 DEBUG (AC) [custom_components.midea_ac_lan.midea_entity] Entity sensor.146235046566413_realtime_power update_state AttributeError("'NoneType' object has no attribute 'loop'"), status = {'total_energy_consumption': 6469.62, 'current_energy_consumption': 0.0, 'realtime_power': 0.0}

chemelli74 commented 3 months ago

Please check with v0.4.3 and if still experience the issue, add the following to configuration.yaml , restart HA, and post the log:

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

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

wuwentao commented 2 months ago

seems only enabled midea_ac_lan debug and not enable midealocal debug. please add both debug log and update to new version to confirm it.

there is a same error msg AttributeError: 'NoneType' object has no attribute 'loop' like #191 [ha_logs.txt], but #191 return error in parse_message()

wuwentao commented 1 month ago

@Buniculbroscoi any updates? please upgrade to latest v0.5.7 version and share the result with us. if latest versionstill not work, you should enable debug log and upload the full log file to this issue.

in addition, as there is no any response for a long time, we will consider to close this issue . please help to update the version and share the info to us ASAP.

thanks

wuwentao commented 1 month ago

as there is no any response for a long time, close this issue now. if bug still exist, please reopen this issue. or directly update the latest result.