CodeFoodPixels / robovac

Add a Eufy RoboVac easily to Home Assistant
Other
110 stars 26 forks source link

Get a lot of error states and long times between status updates #21

Closed shahmirthesquid closed 9 months ago

shahmirthesquid commented 10 months ago

Hi, I have some home assistant automations that keep track of how many times the vacuum has ran. This is so I can be reminded to clean out the vacuum bin. My automation is triggered when the vacuum goes from "docked" to "cleaning".

The issue I am having is that every few mins, my vaccuum shows "Error" as it's state. This interrupts my automations, as they never trigger. Since the vacuum goes from "docked" to "error". And then sometime later once the vacuum has already started cleaning, the integration syncs back up and it goes from "error" to cleaning". Looking at my vacuum's state history I dont see any way I could work around this. As "error" states happen constantly every few mins.

Also there seems to be a massive delay between the vacuum and home assistant integration. If I start cleaning, it will take forever to show up in home assistant, even if im not showing an error state at that moment. I remember this being very quick and snappy before. I think there is some issue in syncing of the vacuum and integration.

I have a eufy 30c (shows up as g30 verge) and am running the latest beta available for this integration.

I will try the 1.0 stable release and see if that fixes my problem.

image
shahmirthesquid commented 10 months ago

switching back to the 1.0 stable release made the vacuum status updates fast and snappy again. I also haven't seen any "error" states in the last 10 mins playing around with the older release of this integration.

CodeFoodPixels commented 10 months ago

What version were you using previously?

shahmirthesquid commented 10 months ago

What version were you using previously?

I was running v1.1.0.beta.3 when these issues occurred.

CodeFoodPixels commented 10 months ago

@shahmirthesquid @thebobbu @DerBaer1986 Could you try main? I've added some additional logging to try debugging this.

Edit: With debug logging enabled please.

DerBaer1986 commented 10 months ago

2023-09-07 19:16:35.449 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Sending to bf5440d07d270b8c21zaae (192.168.178.38:6668): Message(0xa, {'gwId': 'bf5440d07d270b8c21zaae', 'devId': 'bf5440d07d270b8c21zaae'}, 1040446185, <Device bf5440d07d270b8c21zaae (192.168.178.38:6668)>) 2023-09-07 19:16:35.527 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Retrying send due to error.Incomplete read from: bf5440d07d270b8c21zaae (192.168.178.38:6668) : 0 bytes read on a total of undefined expected bytes 2023-09-07 19:16:35.528 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Sending to bf5440d07d270b8c21zaae (192.168.178.38:6668): Message(0xa, {'gwId': 'bf5440d07d270b8c21zaae', 'devId': 'bf5440d07d270b8c21zaae'}, 1040446185, <Device bf5440d07d270b8c21zaae (192.168.178.38:6668)>) 2023-09-07 19:16:35.532 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Retrying send due to error. Connection to bf5440d07d270b8c21zaae (192.168.178.38:6668) failed: Connection lost 2023-09-07 19:16:35.533 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Sending to bf5440d07d270b8c21zaae (192.168.178.38:6668): Message(0xa, {'gwId': 'bf5440d07d270b8c21zaae', 'devId': 'bf5440d07d270b8c21zaae'}, 1040446185, <Device bf5440d07d270b8c21zaae (192.168.178.38:6668)>) 2023-09-07 19:16:35.534 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Retrying send due to error. Connection to bf5440d07d270b8c21zaae (192.168.178.38:6668) failed: [Errno 32] Broken pipe 2023-09-07 19:16:35.534 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Sending to bf5440d07d270b8c21zaae (192.168.178.38:6668): Message(0xa, {'gwId': 'bf5440d07d270b8c21zaae', 'devId': 'bf5440d07d270b8c21zaae'}, 1040446185, <Device bf5440d07d270b8c21zaae (192.168.178.38:6668)>) 2023-09-07 19:16:35.537 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Retrying send due to error. Connection to bf5440d07d270b8c21zaae (192.168.178.38:6668) failed: [Errno 32] Broken pipe 2023-09-07 19:16:35.537 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Sending to bf5440d07d270b8c21zaae (192.168.178.38:6668): Message(0xa, {'gwId': 'bf5440d07d270b8c21zaae', 'devId': 'bf5440d07d270b8c21zaae'}, 1040446185, <Device bf5440d07d270b8c21zaae (192.168.178.38:6668)>) 2023-09-07 19:16:35.539 ERROR (MainThread) [custom_components.robovac.tuyalocalapi] Connection to bf5440d07d270b8c21zaae (192.168.178.38:6668) failed: [Errno 32] Broken pipe 2023-09-07 19:16:35.549 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Disconnected from bf5440d07d270b8c21zaae (192.168.178.38:6668)

2023-09-07 19:16:55.451 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Connecting to bf5440d07d270b8c21zaae (192.168.178.38:6668) 2023-09-07 19:16:55.540 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Sending to bf5440d07d270b8c21zaae (192.168.178.38:6668): Message(0xa, {'gwId': 'bf5440d07d270b8c21zaae', 'devId': 'bf5440d07d270b8c21zaae'}, 1040466187, <Device bf5440d07d270b8c21zaae (192.168.178.38:6668)>) 2023-09-07 19:16:55.554 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi] Received message from bf5440d07d270b8c21zaae (192.168.178.38:6668): Message(0xa, {'dps': {'2': False, '5': 'Nosweep', '15': 'completed', '101': True, '102': 'Max', '103': False, '104': 100, '105': 'MopHigh', '106': 0, '107': False, '108': '[813,-571,-288]', '109': 5, '110': 0, '111': 46, '112': 380502, '113': 380502, '114': 380502, '118': True, '119': 380502, '120': 5518, '122': 'Nosweep', '127': 227450, '129': False, '132': 18, '133': 0, '134': 1}}, 1040466187, None) 2023-09-07 19:16:55.556 INFO (MainThread) [custom_components.robovac.tuyalocalapi] Received updated state bf5440d07d270b8c21zaae (192.168.178.38:6668): {'2': False, '5': 'Nosweep', '15': 'completed', '101': True, '102': 'Max', '103': False, '104': 100, '105': 'MopHigh', '106': 0, '107': False, '108': '[813,-571,-288]', '109': 5, '110': 0, '111': 46, '112': 380502, '113': 380502, '114': 380502, '118': True, '119': 380502, '120': 5518, '122': 'Nosweep', '127': 227450, '129': False, '132': 18, '133': 0, '134': 1}

CodeFoodPixels commented 10 months ago

You should get a message that starts with "State changed to error. Error message:" when it goes into an error state. Has it reported an error state since you switched to main?

DerBaer1986 commented 10 months ago

Yes, i switched to Main, but without reconfiguration.

2023-09-07 23:08:26.793 DEBUG (MainThread) [custom_components.robovac.vacuum] State changed to error. Error message: Connection to the vacuum failed

error_log-6.txt

shahmirthesquid commented 10 months ago

Debug output from Eufy Robovac v1.1.0.beta.4:

home-assistant_robovac_2023-09-07T21-25-30.275Z.log

Vacuum Connection History:

image

shahmirthesquid commented 10 months ago

Tip for others trying to submit their log file! Please just drag and drop the file onto github! You don't need to copy paste the text or upload to cloud storage. Dragging and dropping the file into the comment text box will directly upload it to github and make it accessible for others. See my previous comment for an example.

DerBaer1986 commented 10 months ago

Tip for others trying to submit their log file! Please just drag and drop the file onto github! You don't need to copy paste the text or upload to cloud storage. Dragging and dropping the file into the comment text box will directly upload it to github and make it accessible for others. See my previous comment for an example.

@shahmirthesquid Not on the Android App.

Its possible to add a File with Pictures Button in Comment edit.

CodeFoodPixels commented 10 months ago

@shahmirthesquid beta 4 doesn't have the additional logging, so I can't do much with that log file. Can you try with main please?

imhotep commented 10 months ago

My logs:

2023-09-08 09:55:13.992 ERROR (MainThread) [custom_components.robovac.tuyalocalapi] Incomplete read from: eb0cd280189d9f12caawyv (192.168.1.197:6668) : 0 bytes read on a total of undefined expected bytes
2023-09-08 09:55:33.937 ERROR (MainThread) [custom_components.robovac.tuyalocalapi] Connection to eb0cd280189d9f12caawyv (192.168.1.197:6668) failed: [Errno 32] Broken pipe
2023-09-08 09:56:34.094 ERROR (MainThread) [custom_components.robovac.tuyalocalapi] Incomplete read from: eb0cd280189d9f12caawyv (192.168.1.197:6668) : 0 bytes read on a total of undefined expected bytes

Not seeing this issue in 1.0. I just have to add my own vacuum in the list.

shahmirthesquid commented 10 months ago

@shahmirthesquid beta 4 doesn't have the additional logging, so I can't do much with that log file. Can you try with main please?

Oh I apologize, I could've sworn that main wasn't an option yesterday when I tried to redownload, so I just assumed you meant the latest beta. But it appears in the list now. Will send log files later today once I have some time.

image
shahmirthesquid commented 10 months ago

Debug output from Eufy Robovac version "main": home-assistant_robovac_2023-09-08T20-59-41.461Z.log

Vacuum Connection history: image

CodeFoodPixels commented 10 months ago

Main has some logic now that should help reduce the flipping between error and another state. Please give it a try!

imhotep commented 10 months ago

Mine now just stays on error all the time :/

Traceback (most recent call last):
  File "/config/custom_components/robovac/tuyalocalapi.py", line 725, in async_update_state
    _LOGGER.info("Received updated state {}: {}").format(self, self._dps)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'format'
CodeFoodPixels commented 10 months ago

That was me making a brainfart, please give it another go

imhotep commented 9 months ago

It's a little better (The vacuum is active and the commands seem to work with occasional errors) but the status is still not reporting/updating correctly. Let me know if there is anything I can do to debug further.

2023-09-12 07:33:46.569 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140206814545088] Connection to eb0cd280189d9f12caawyv (192.168.1.197:6668) failed: [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/config/custom_components/robovac/tuyalocalapi.py", line 755, in _async_send
    await self.writer.drain()
  File "/usr/local/lib/python3.11/asyncio/streams.py", line 378, in drain
    await self._protocol._drain_helper()
  File "/usr/local/lib/python3.11/asyncio/streams.py", line 167, in _drain_helper
    raise ConnectionResetError('Connection lost')
ConnectionResetError: Connection lost
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/robovac/tuyalocalapi.py", line 755, in _async_send
    await self.writer.drain()
  File "/usr/local/lib/python3.11/asyncio/streams.py", line 366, in drain
    raise exc
  File "/config/custom_components/robovac/tuyalocalapi.py", line 755, in _async_send
    await self.writer.drain()
  File "/usr/local/lib/python3.11/asyncio/streams.py", line 366, in drain
    raise exc
  File "/config/custom_components/robovac/tuyalocalapi.py", line 755, in _async_send
    await self.writer.drain()
  File "/usr/local/lib/python3.11/asyncio/streams.py", line 366, in drain
    raise exc
  File "/config/custom_components/robovac/tuyalocalapi.py", line 755, in _async_send
    await self.writer.drain()
  File "/usr/local/lib/python3.11/asyncio/streams.py", line 366, in drain
    raise exc
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1051, in write
    n = self._sock.send(data)
        ^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
    response_data = await _handle_entity_call(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/robovac/vacuum.py", line 380, in async_start
    await self.vacuum.async_set({"5": self.mode}, None)
  File "/config/custom_components/robovac/tuyalocalapi.py", line 702, in async_set
    await message.async_send(self, callback)
  File "/config/custom_components/robovac/tuyalocalapi.py", line 528, in async_send
    await device._async_send(self)
  File "/config/custom_components/robovac/tuyalocalapi.py", line 787, in _async_send
    await self._async_send(message, retries=retries - 1)
  File "/config/custom_components/robovac/tuyalocalapi.py", line 787, in _async_send
    await self._async_send(message, retries=retries - 1)
  File "/config/custom_components/robovac/tuyalocalapi.py", line 787, in _async_send
    await self._async_send(message, retries=retries - 1)
  [Previous line repeated 1 more time]
  File "/config/custom_components/robovac/tuyalocalapi.py", line 761, in _async_send
    raise ConnectionException(
custom_components.robovac.tuyalocalapi.ConnectionException: Connection to eb0cd280189d9f12caawyv (192.168.1.197:6668) failed: [Err
no 32] Broken pipe
imhotep commented 9 months ago

@CodeFoodPixels any idea regarding broken pipe error? Does this happen with other vacuums?

CodeFoodPixels commented 9 months ago

Happens on mine every so often, just means that the connection to the vacuum failed part way through

On Fri, 22 Sept 2023, 16:50 Anis Kadri, @.***> wrote:

@CodeFoodPixels https://github.com/CodeFoodPixels any idea regarding broken pipe error? Does this happen with other vacuums?

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/robovac/issues/21#issuecomment-1731649664, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVHPUA6R742TX3MLZOLX3WXVPANCNFSM6AAAAAA4LJ7KPU . You are receiving this because you were mentioned.Message ID: @.***>

CodeFoodPixels commented 9 months ago

Please try beta 5, it should be much quicker to update and should have less errors

imhotep commented 9 months ago

@CodeFoodPixels just tried today. It seems to work a lot better indeed!

CodeFoodPixels commented 9 months ago

Released in v1.1.0