CodeFoodPixels / robovac

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

IP Address not found #18

Closed LarveyOfficial closed 9 months ago

LarveyOfficial commented 10 months ago

Since updating to beta 3. My LR20's IP Address is no longer found (In attributes) and I can no longer manually configure it.

Log spits this out:


Traceback (most recent call last):
  File "/config/custom_components/robovac/__init__.py", line 57, in async_setup
    await tuyalocaldiscovery.start()
  File "/config/custom_components/robovac/tuyalocaldiscovery.py", line 29, in start
    self._listeners = await asyncio.gather(listener, encrypted_listener)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1386, in create_datagram_endpoint
    raise exceptions[0]
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1370, in create_datagram_endpoint
    sock.bind(local_address)
OSError: [Errno 98] Address in use```
CodeFoodPixels commented 10 months ago

Are you using the localtuya integration too?

CodeFoodPixels commented 10 months ago

Please try beta 4

LarveyOfficial commented 10 months ago

That seems to have fixed it! Although I had to manually configure the IP by going to configure. Thanks!

LarveyOfficial commented 10 months ago

After further testing, it seems it now does not update its status unless I manually reload the integration. It should be noted I am using localtuya

LarveyOfficial commented 10 months ago

I've been using this fork I made: https://github.com/LarveyOfficial/robovac Which seems to not have any issues at all sending commands and receiving updates.

LarveyOfficial commented 10 months ago

Although recently I've switched to Home Assistant OS instead of docker, and now even my fork is having issues. Seems my localtuya is causing issues with it. Is there a work around? Maybe disable localtuya's discovery in some way?

LarveyOfficial commented 9 months ago

Seems Localtuya is causing issues with the newest version for me.

I've also run into the issue with my fork (which is probably irrelevant but maybe it will provide some more context). But whenever I restart home assistant I have to re-configure the vacuum as it gives a "Connection refused" error. I at least can use it this for now. Thanks for the work!

CodeFoodPixels commented 9 months ago

Yeah, localtuya will be clashing with the autodiscovery at the moment. They've recently merged a PR that I made so hopefully that sorts it.

LarveyOfficial commented 9 months ago

Nice!

LarveyOfficial commented 9 months ago

Was able to get it to somewhat work with the newest version of LocalTuya (main branch) but I have to disable autodiscovery and manually set the IP. if not it just states "IP Address not set". Maybe I didn't wait long enough, but I'm just going to leave it how it is for now. (This is on main, if I don't reply after this assume its the same behavior on beta 4 as I am about to test it now)

LarveyOfficial commented 9 months ago

*Same behavior on beta 4. Noticed that if you enable auto discovery, and manually type in an IP address, the IP address is not saved. But I waited about 5 minutes for auto discovery to kick in, no luck.

CodeFoodPixels commented 9 months ago

If you enable debug logging and change the IP manually, you should get a message like "Updated ip address of XXX to XXX" in the logs if autodiscovery is working

LarveyOfficial commented 9 months ago

So, I noticed even with autodiscovery off, and manually setting the IP address. The status of the vacuum does not update, unless I reload the integration.

LarveyOfficial commented 9 months ago

I have enabled de-bugging. It does not say "Update IP Address of XX to XXX", it just says "disconnected from XXX" when I enable auto discovery. When disabling Auto discovery and manually setting the IP address it says "Connecting to XXX (IP:6668)" in the logs, and seems to connect fine.

When sending a command, it states "Sending to XXX (IP:6668)" and the vacuum does start, but then the logs say "Received message from XXX (IP:6668): Message(0x8, {'dps': {'15': 'Running'}, 't': 1695146056}, 0, None)" and then it says "Received updated state XXXX (IP:6668): {'2': False, '5': 'auto', '15': 'Running', '101': False, '104': 81, '106': 0, '107': False, '109': 60, '110': 1, '111': 45, '118': True, '122': 'Nosweep', '129': False, '130': 'Standard', '131': False, '135': True, '137': 30, '115': 'REALLYLONGSTRING', '139': 'STRING'}""

and the Home assistant status does not update. Unless I reload the integration.

LarveyOfficial commented 9 months ago

It looks like sometimes it updates the status, but sometimes it does not. I got it to say cleaning once after about 5 minutes (which is a bit late but understandable), and when doing return to dock I got: [custom_components.robovac.vacuum] Return home Pressed, with multiple "sending" and "receiving" logs, Yet no update on the status.

LarveyOfficial commented 9 months ago

Slowly getting closer to getting it working fully. I wanted to say thanks for working on this.

LarveyOfficial commented 9 months ago

Latest Log is really long, hopefully nothing incriminating, but ill put it here 2023-09-19 14:00:31.495 INFO (MainThread) [custom_components.robovac.tuyalocalapi] Received updated state eb4a4307033ae601d9u2ag (192.168.50.203:6668): {'2': True, '5': 'auto', '15': 'Running', '101': False, '104': 80, '106': 0, '107': False, '109': 0, '110': 0, '111': 45, '118': True, '122': 'Continue', '129': False, '130': 'Standard', '131': False, '135': True, '137': 30, '115': 'eyJkSW5mbyI6eyJpbmZvVHlwZSI6MTE1LCJyZXN1bHQiOiJPIn0sImhhcmR3YXJlIjp7InZvbHRhZ2UiOjE1LjQyNzAwMDA0NTc3NjM2N30sInZhbHVlIjpbXX0=', '139': 'eyJkSW5mbyI6eyJ2YWx1ZSI6W119LCJ2YWx1ZSI6W119', '112': 'eyJkSW5mbyI6eyJpbmZvVHlwZSI6MTEyLCJyZXN1bHQiOiJPIn0sInZhbHVlIjpbeyJsZXZlbCI6IkxvdyIsIm1vZGUiOiJ3YXRlck1vZGUifSx7ImxldmVsIjoiUXVpZXQiLCJtb2RlIjoiY2xlYW5MZXZlbCJ9LHsibGV2ZWwiOiIxIiwibW9kZSI6IkNvbGxlY3RNb2RlIn0seyJsZXZlbCI6IkNoYXJnZUJhc2UiLCJtb2RlIjoiRG9ja1R5cGUifSx7ImxldmVsIjoiU3dlZXAiLCJtb2RlIjoiY2xlYW5Nb2RlIn0seyJsZXZlbCI6Ik9GRiIsIm1vZGUiOiJhdXRvVVZDIn0seyJsZXZlbCI6IkR1c3RUYW5rIiwibW9kZSI6IkJveFR5cGUifV19', '113': 'eyJkSW5mbyI6eyJpbmZvVHlwZSI6MTEzLCJyZXN1bHQiOiJPIn0sInZhbHVlIjpbeyJtb2RlIjoiY29sbGVjdFN3aXRjaCIsInN3aXRjaCI6ZmFsc2V9LHsibW9kZSI6ImNoaWxkU3dpdGNoIiwic3dpdGNoIjpmYWxzZX0seyJtb2RlIjoibGFzZXJBdm9pZGFuY2UiLCJzd2l0Y2giOmZhbHNlfSx7Im1vZGUiOiJVSUxFRCIsInN3aXRjaCI6dHJ1ZX0seyJtb2RlIjoiVVZDIiwic3dpdGNoIjpmYWxzZX1dfQ==', '117': 'eyJDbG91ZFN5bmMiOiJPIiwiTXVsdGlNYXBzIjoiT0ZGIiwiZEluZm8iOnsiaW5mb1R5cGUiOjExN319', '114': 'eyJkSW5mbyI6eyJpbmZvVHlwZSI6MTE0LCJyZXN1bHQiOiJPIn0sInZhbHVlIjpbeyJ0eXBlIjoiQWxsVGltZSIsInZhbHVlIjo1NzAzNzN9LHsidHlwZSI6IkFsbEFyZWEiLCJ2YWx1ZSI6ODA1M30seyJ0eXBlIjoiQ2xlYW5Db3VudCIsInZhbHVlIjozNTF9XX0=', '116': 'eyJjb25zdW1hYmxlIjp7ImR1cmF0aW9uIjp7IkZNIjo2MywiUkIiOjY2LCJTQiI6NjcsIlNTIjoyMn19LCJkSW5mbyI6eyJpbmZvVHlwZSI6MTE2LCJyZXN1bHQiOiJPIn19', '142': 'eyJkSW5mbyI6eyJpbmZvVHlwZSI6MTQyfSwic3dpdGNoIjoiT04ifQ=='}

For context: vacuum was docked in this state, for about 5 minutes after pressing return home.

LarveyOfficial commented 9 months ago

I tested with my branch I currently have forked. https://github.com/LarveyOfficial/robovac And it seems to not have the same issue, so maybe something between then and now has changed. But I notice that when I push start or clean, it usually updates within 15-30 seconds. Unless I do it from home assistant itself, then its instant and states the status was update by me pushing start.

I did notice it spitting out a

2023-09-19 14:13:57.714 ERROR (MainThread) [custom_components.robovac] failed to set up discovery
Traceback (most recent call last):
File "/config/custom_components/robovac/__init__.py", line 54, in async_setup
await tuyalocaldiscovery.start()
File "/config/custom_components/robovac/tuyalocaldiscovery.py", line 28, in start
self._listeners = await asyncio.gather(listener, encrypted_listener)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1386, in create_datagram_endpoint
raise exceptions[0]
File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1370, in create_datagram_endpoint
sock.bind(local_address)
OSError: [Errno 98] Address in use

error, but I don't know if that is due to just how old it is.

CodeFoodPixels commented 9 months ago

That error is due to the localtuya stuff.

But I notice that when I push start or clean, it usually updates within 15-30 seconds. Unless I do it from home assistant itself, then its instant and states the status was update by me pushing start.

What do you mean doing it from Home Assistant itself? As opposed to doing it in the home assistant app?

LarveyOfficial commented 9 months ago

Yeah I fixed the localtuya errors on my branch already. What I mean by that, is on my branch, I can press start or run or return home, either on the actual eufy app, or on home assistant, and both are instant. The only time it isn't instant is sometimes there is a 20 second delay between me pressing run on the Eufy App and home assistant updating.

On the newest version, (main) I run into the issue in which it either takes a minute to update. OR it just doesn't update at all unless I reload the integration. This happens when activating the vacuum on home assistant AND the Eufy app. The only times it updates without a reload is when starting the vacuum. But it's rare, and most of the time it requires a reload.

CodeFoodPixels commented 9 months ago

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

CodeFoodPixels commented 9 months ago

Should be fixed in v1.1.0, please reopen if not