CodeFoodPixels / robovac

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

Support for L60 SE #85

Open meanandpinchy opened 1 month ago

meanandpinchy commented 1 month ago

The unit is detected, but has no entities except for battery, which is "unavailable". Please add support for the L60 SE.

mumpers68 commented 2 weeks ago

I second the support for the L60 SES!

stoozak commented 2 weeks ago

yes, please!

Harm-Veraa commented 1 week ago

I was looking into this, seems the TUYA_CODES are incorrect for this robovac. Yet to firgure out any of the codes, except for battery life, which is 163. Is there any documentation about these codes available?

For reference, this is a response when the device is doing nothing: {'151': True, '156': True, '158': 'Turbo', '159': aTrue, '160': False, '161': 41, '163': 99}

stoozak commented 1 week ago

,

Where do we plug these in? Happy to test and feedback.

Harm-Veraa commented 1 week ago

Depends if you have main branch or better-dps branch. For main branch they are at the top of the 'vacuum' file, if I am not mistaken (currently on the other branch). On better-dps branch they are at the specific file for your vacuum. In our case this is T2278 (or at least for me, I have the hybrid, not sure if it's different but otherwise I expect T2277).

In both cases, before it will even load, you need to add your vacuum. In the better-dps branch you copy the specific model file and add it to the list of vacs in init. In the main you can check the robovac file and add it to the list of 'L' models.

If you are on better-dps branch, also make sure to make a comment for extra features (as they crash currently, possible because code is incorrect, not sure).

robovac_features = 0; # RoboVacEntityFeature.CLEANING_TIME | RoboVacEntityFeature.CLEANING_AREA | RoboVacEntityFeature.DO_NOT_DISTURB | RoboVacEntityFeature.AUTO_RETURN | RoboVacEntityFeature.ROOM | RoboVacEntityFeature.ZONE | RoboVacEntityFeature.BOOST_IQ | RoboVacEntityFeature.MAP | RoboVacEntityFeature.CONSUMABLES

After all of this, a logger can be added to log everything. If you change the code of the battery to 161, you'll see that one works in the home panel.

Harm-Veraa commented 1 week ago

It's curious, if I start the robot or do something with it, the status does not change according to the Logger. Perhaps another api call is required?

Harm-Veraa commented 1 week ago

Should the developer read this, and willing to look into it. Some more messages from the device, when I start it via the Eufy app. It looks like it's encrypted. I noticed that '179' has 4 values which would match potential states the device is in. (positioning, cleaning, heading home, charging). These only reported after a first run tho.

{'151': True, '156': True, '158': 'Turbo', '159': True, '160': False, '161': 41, '163': 99, '177': 'DAjZhNCLlIztzgFSAA==', '153': 'BBADGgA=', '178': 'DQiuzqvylIztzgESAR8=', '152': 'AggG', '179': 'FhIUEhIIEBABIGMozsPsswYwgcTsswY=', '173': 'GAoSMgoKAggBEgQIARgPOgQKAggBEgIIAQ==', '176': 'JgoAGgBSCBoAIgIIASoAWDBiFAoSCghOcjE4X0lvVBoGEKnC7LMG', '169': 'xxx'}

stoozak commented 1 week ago

Righto, so using the DPS branch I copied the 2273 config and renamed it to 2277 and added the reference to the model number in init.

Using 161 the battery shows as 0%, and log shows the following:


2024-06-25 21:10:21.757 ERROR (MainThread) [homeassistant.components.vacuum] Error adding entity vacuum.fred for domain vacuum with platform robovac
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/locks.py", line 386, in acquire
    await fut
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/config/custom_components/robovac/tuyalocalapi.py", line 911, in async_recieve
    await self._recieve_task
  File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for
    async with timeouts.timeout(timeout):
  File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 914, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1354, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/robovac/vacuum.py", line 297, in async_added_to_hass
    await self.async_forced_update()
  File "/config/custom_components/robovac/vacuum.py", line 326, in async_forced_update
    await self.async_update_vacuum()
  File "/config/custom_components/robovac/vacuum.py", line 322, in async_update_vacuum
    await self.vacuum.async_get()
  File "/config/custom_components/robovac/tuyalocalapi.py", line 763, in async_get
    response = await self.async_recieve(message)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/robovac/tuyalocalapi.py", line 923, in async_recieve
    raise ResponseTimeoutException(
custom_components.robovac.tuyalocalapi.ResponseTimeoutException: Timed out waiting for response to sequence number 818946
2024-06-25 21:10:26.827 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi.bfb2df8ed89ef1ee85zulu] Processing queue. Current length: 1
2024-06-25 21:10:26.827 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi.bfb2df8ed89ef1ee85zulu] Sending to bfb2df8ed89ef1ee85zulu (192.168.10.18:6668): Message(0x9, b'', 0, <Device bfb2df8ed89ef1ee85zulu (192.168.10.18:6668)>)
2024-06-25 21:10:26.828 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi.bfb2df8ed89ef1ee85zulu] Connecting to bfb2df8ed89ef1ee85zulu (192.168.10.18:6668)
2024-06-25 21:10:26.836 DEBUG (MainThread) [custom_components.robovac.tuyalocalapi.bfb2df8ed89ef1ee85zulu] Received message from bfb2df8ed89ef1ee85zulu (192.168.10.18:6668): Message(0x9, b'', 0, None)
Harm-Veraa commented 1 week ago

I also get this error sometimes, seems to be when I clicked a button and then the sequence number goes haywire.. Not sure tho. In any case, the last 3 messages show it is working. At least the communication part is.. Can you try 163 for battery? That is what I have currently.

Harm-Veraa commented 1 week ago

One thing to add. Battery wont show in a default card (when the device is so-called offline). Go to the device info itself under settings -> devices. Should show there.

stoozak commented 1 week ago

Hmmm, no luck. It still shows 0%. I also don't seem to get the log state with the encrypted numbers that you got.

Harm-Veraa commented 1 week ago

Did you enable debug logging?

stoozak commented 1 week ago

Afraid so :(

Harm-Veraa commented 1 week ago

Mhh okay odd. I don't know why it won't work for you.. when I have more time I might look into it further. Should I find a proper solution I'll see if I can create a PR

stoozak commented 1 week ago

Some of these codes may be helpful: https://github.com/CodeFoodPixels/robovac/issues/42#issuecomment-1873242870