Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Water Heater broken pipe #310

Closed
Rihan9 opened this issue Sep 13, 2024 · 15 comments
Closed

Water Heater broken pipe #310

Rihan9 opened this issue Sep 13, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@Rihan9
Copy link

Rihan9 commented Sep 13, 2024

HA core version

2024.8.0

Current integration version

0.5.7

Last known working integration version

none

Device type and model

Electric Water Heater 510003CN

Working mobile app

SmartHome

The description of problem

Hi,
I randomly receive the error on the logs described below. The device goes "offline". The attribute keep being listened as working but every command generate the error and fail. The reload of the integration solve it, but i can't reload the integration when I'm sleeping! And I can't check every time if the automation run succesfully. This problem is a serious one for me, because the water header is completed automated with my current power consumption and energy price ranges and my schedule. I don't want to take a cold shower again :c

The logs

when available. for now, the stacktrace:
File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1693, in async_turn_off
await self.hass.async_add_executor_job(ft.partial(self.turn_off, **kwargs))
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/switch.py", line 50, in turn_off
self._device.set_attribute(attr=self._entity_key, value=False)
File "/usr/local/lib/python3.12/site-packages/midealocal/devices/e2/init.py", line 159, in set_attribute
self.build_send(message)
File "/usr/local/lib/python3.12/site-packages/midealocal/device.py", line 287, in build_send
self.send_message(msg)
File "/usr/local/lib/python3.12/site-packages/midealocal/device.py", line 258, 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 280, in send_message_v3
self.send_message_v2(data)
File "/usr/local/lib/python3.12/site-packages/midealocal/device.py", line 265, in send_message_v2
self._socket.send(data)
BrokenPipeError: [Errno 32] Broken pipe

@Rihan9 Rihan9 added the bug Something isn't working label Sep 13, 2024
@Rihan9 Rihan9 changed the title Water Heater broken pip Water Heater broken pipe Sep 13, 2024
@wuwentao
Copy link
Owner

wuwentao commented Sep 17, 2024

thanks for your bug report.
it should be a know issue and share the same root cause with #276 and #306
we are try to fix it, but found it have more impact and process issue, I'm still doing some testing and changes for it.
we will publish a new release to fix it this week (after I have test it and confirm it can works well).

@adizag
Copy link

adizag commented Sep 18, 2024

Similar here
ACs not showing problems like not being "unavailable" but trying to toggle the AC I get this "broken pipe" errno32 message.
Solved by reloading the integration.

Screenshot_20240918-231830

@wuwentao
Copy link
Owner

@Rihan9 @adizag
it should be fix with latest release v0.5.8, please upgrade and confirm the result.
close current issue, if the same issue still exist, we can continue update in current issue or reopen it later.

@adizag
Copy link

adizag commented Sep 26, 2024

@wuwentao
I'm happy to inform that this message does not appear any more.

BUT, I'm not happy to inform that the ACs are now not working well...
It gets unresponsive, but still show last status like "cooling". I'm unable to control the AC anymore. only reloading the integration will gain back control.

Please help :)

@Rihan9
Copy link
Author

Rihan9 commented Sep 26, 2024

I was Just coming here to post a new issue or reopen this. I'm sorry, but now It is Just unresponsive. I Need to reload the integration before every command and I don't see the result until I reload the integration again

@wuwentao
Copy link
Owner

wuwentao commented Sep 27, 2024

@adizag @Rihan9
thanks, it should be a knonw issue with latest v0.5.9, the status refresh will be delay for 1-30 seconds after you change the status.
already have a fix and still waiting for test new issue test result.
once got a confirmation, will publish a new release to fix it.

if you want to manual test with the latest changes to confirm with it, below is the steps:

test methdod:
update to latest v0.5.9 and replace device.py in midea-local lib with latest changes in this URL https://github.com/rokam/midea-local/blob/7a9a58abaf6510570033233da238b1900c942e54/midealocal/device.py

detail steps:

  1. if you are using HAOS, you should install Add-on [Advanced SSH & Web Terminal] and disable [Protected Mode], once it done, you can ssh to your HAOS, and enter docker in HAOS docker exec -it homeassistant /bin/bash, contiune the step to check midea-local install path
  2. if you not using HAOS, just check midea-local install path as the next step
  3. get midea-local install path with command pip show midea-local, it will show info for you, for example, my location is Location: /usr/local/lib/python3.12/site-packages
  4. then we can replace local /usr/local/lib/python3.12/site-packages/midealocal/device.py with the latest code changes from the URL https://github.com/rokam/midea-local/blob/7a9a58abaf6510570033233da238b1900c942e54/midealocal/device.py
    i just using vi to delete the full file and paste the content to it vi /usr/local/lib/python3.12/site-packages/midealocal/device.py , once the file is opend, the bottom will show you 1/690 0%, 1 mean line 1, and 690 mean total 690 lines(based on your local installed version), you can press 690 + dd to delete all the content in this file, once it deleted, you will see [[Modified] 1/1 100%] at the bottom, press i to insert mode, copy the file content and paste all the content to it (from your ssh Terminal app), finally, press :wq to save and exit
  5. reboot HA and test with it, confirm whether it fix your bug

If the testing process is too complicated, just ignore it and we will publish a fix in future.
the main purpose is replace the device.py with latest code and test it before publish

@Rihan9
Copy link
Author

Rihan9 commented Sep 27, 2024

Hi @wuwentao ,
no problem, I'm gladly help you if I can. Unfortunately, the fix doesn't seems to work. I'm trying to create a short gif to let you see the strange behavior. For now, I'm attaching the log.
Another thing: we are currently writing in a closed issue. Do you think is better to reopon it or move to a new one?
home-assistant_midea_ac_lan_2024-09-27T08-57-18.412Z.log
.

@Rihan9
Copy link
Author

Rihan9 commented Sep 27, 2024

I found a pretty useful tool to create a gif, I like it. Attached, the gif that describe the problem, I hope it's useful.
midea_ac_lan_310

Another thing: after a couple of try, the device move to unavailable state and I need to restart the entire home assistant to let it come back. I didn't see this behavior before the the fix, but I admid that I didn't search for it, so I'm not sure if it got introduced with the fix.

@adizag
Copy link

adizag commented Sep 27, 2024

@wuwentao
I didn't have the time to check your new fix.

Meanwhile, I've changed back to v0.5.6 and now everything is working great again.
I don't know what have changed but this info may give you a good direction.

Thank you for your appreciated efforts!

@wuwentao
Copy link
Owner

Hi @wuwentao , no problem, I'm gladly help you if I can. Unfortunately, the fix doesn't seems to work. I'm trying to create a short gif to let you see the strange behavior. For now, I'm attaching the log. Another thing: we are currently writing in a closed issue. Do you think is better to reopon it or move to a new one? home-assistant_midea_ac_lan_2024-09-27T08-57-18.412Z.log .

thanks for your update, it should works and just the status refresh delayed, after 30 seconds, it should synced with the expected result. I just try to find a good solution to quickly refresh it.

there is some opening PR exist with the same refresh delay issue. so just ignore the stauts, we just need to confirm the issue and fix.

and also confirmed it should works for AC/C3/etc device and not works for some different devices types.
so I will try to find a new solution for these unspported devices.

@wuwentao
Copy link
Owner

@wuwentao I didn't have the time to check your new fix.

Meanwhile, I've changed back to v0.5.6 and now everything is working great again. I don't know what have changed but this info may give you a good direction.

Thank you for your appreciated efforts!

thank you very much for your info share and update, it should works with old release, and old release may works for your devices , but it still have some different issue, and we try to fix these issue and introduced new issue.

still working on is , and will try to fix all the current known issue.

@wuwentao
Copy link
Owner

wuwentao commented Oct 2, 2024

please have a try with latest v0.6.0.
will be publish in some hours later, PR already there and waitting for approve.

@Rihan9
Copy link
Author

Rihan9 commented Oct 2, 2024

Hi,
i Just upgrated it. It seems to work like a charm. I'll monitoring this for a couple of days and come back with a final feedback. Thank you for your amazing work!

@adizag
Copy link

adizag commented Oct 7, 2024

please have a try with latest v0.6.0. will be publish in some hours later, PR already there and waitting for approve.

I can also approve - it has already worked flawlessly for 2 days straight.
Thank you for your efforts!

@wuwentao
Copy link
Owner

wuwentao commented Oct 8, 2024

thanks all for your confirmation.
if there is any new bug, please help to report it.

Repository owner locked as resolved and limited conversation to collaborators Oct 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants