CodeFoodPixels / robovac

Add a Eufy RoboVac easily to Home Assistant
Other
147 stars 32 forks source link

Entities not populating with Eufy L60 #40

Open rickadam opened 1 year ago

rickadam commented 1 year ago

I have a Eufy L60. When I configure the integration I do get an IP but none of the entities populate in home assistant apart from:

sensor.robovac_battery

which shows as unavailable

Any ideas why this may happen? I've tried removing and re-adding the integration and reconfiguring the vac a couple of times

CodeFoodPixels commented 1 year ago

Do you know the model number of the L60? Is there anything in the logs?

On Thu, 16 Nov 2023 at 13:38, rickadam @.***> wrote:

I have a Eufy L60. When I configure the integration I do get an IP but none of the entities populate in home assistant. Any ideas why this may happen? I've tried removing and re-adding the integration and reconfiguring the vac a couple of times

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/robovac/issues/40, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVC2YBFSDQXN7HW44CDYEYJOBAVCNFSM6AAAAAA7OFRPQSVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TMOBXGY4DQNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rickadam commented 1 year ago

I've found it now, it's T2267

On Thu, 16 Nov 2023, 14:35 Luke Bonaccorsi, @.***> wrote:

Do you know the model number of the L60? Is there anything in the logs?

On Thu, 16 Nov 2023 at 13:38, rickadam @.***> wrote:

I have a Eufy L60. When I configure the integration I do get an IP but none of the entities populate in home assistant. Any ideas why this may happen? I've tried removing and re-adding the integration and reconfiguring the vac a couple of times

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/robovac/issues/40, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABEPFVC2YBFSDQXN7HW44CDYEYJOBAVCNFSM6AAAAAA7OFRPQSVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TMOBXGY4DQNI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/robovac/issues/40#issuecomment-1814555943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZE3IG6B6AYH7ZFADGXTMTYEYQEFAVCNFSM6AAAAAA7OFRPQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJUGU2TKOJUGM . You are receiving this because you authored the thread.Message ID: @.***>

CodeFoodPixels commented 1 year ago

Ah, the L60 is a new device, it's not in the supported list at the moment. I'll need to add it

DellBoy4 commented 1 year ago

Hi,

I have the same issue with the L60. However i also have an X8 that was working until i added the L60 to the app and HA pulls it in then both devices get only the battery sensor and show as unavailable and the X8 no longer works. Is that expected due to the L60 not being supported? Any ideas on when the L60 can be added?

iandarbey commented 1 year ago

Plus 1 for the request on this being supported. Just ordered one on the black Friday early sales.

wardozer commented 1 year ago

I have the same issue with x8 pro

jb123567 commented 1 year ago

@CodeFoodPixels Also looking for support for the L60, is it in your future plans?

stewartpriest commented 11 months ago

Ah, the L60 is a new device, it's not in the supported list at the moment. I'll need to add it

I added the T2267 model to the L series section in robovac.py, but no joy. Is there more to adding a device than just adding the model number? I'm happy to attempt a code change and contribute, but not entirely clear how the code all hangs together.

jb123567 commented 11 months ago

Ah, the L60 is a new device, it's not in the supported list at the moment. I'll need to add it

I added the T2267 model to the L series section in robovac.py, but no joy. Is there more to adding a device than just adding the model number? I'm happy to attempt a code change and contribute, but not entirely clear how the code all hangs together.

I have added it to the supported list in the file and it now displays correctly, and is communicating with HA according to the logs, however it reports unavailable unfortunately, it seems as though there may be some deeper issues following a recent firmware update where the Robovacs are sending unknown strings back.

NiekBrw commented 11 months ago

Following since my L60 is also not working

jb123567 commented 11 months ago

Anyone got anywhere with this? I'm wondering if the latest firmware update has changed the code?

TomG736 commented 10 months ago

I have started a fork looking at the L60.

It currently only supports battery, fan level and auto home (and voice level but not sure the rest of the integration supports it).

If you try it out there will be logs showing what messages are received.

It would be good if people can try and correlate the values with settings in the app as I currently don't have much time.

Be careful sending the base64 strings (look like jumbled text) as e.g. message 176 has at least your WIFI name in it.

jb123567 commented 10 months ago

I have started a fork looking at the L60.

It currently only supports battery, fan level and auto home (and voice level but not sure the rest of the integration supports it).

If you try it out there will be logs showing what messages are received.

It would be good if people can try and correlate the values with settings in the app as I currently don't have much time.

Be careful sending the base64 strings (look like jumbled text) as e.g. message 176 has at least your WIFI name in it.

I have installed, the battery level now reports correctly, however the RoboVac itself reports as unavailable. I assume yours is working as expected with limited functionality?

TomG736 commented 10 months ago

I have started a fork looking at the L60. It currently only supports battery, fan level and auto home (and voice level but not sure the rest of the integration supports it). If you try it out there will be logs showing what messages are received. It would be good if people can try and correlate the values with settings in the app as I currently don't have much time. Be careful sending the base64 strings (look like jumbled text) as e.g. message 176 has at least your WIFI name in it.

I have installed, the battery level now reports correctly, however the RoboVac itself reports as unavailable. I assume yours is working as expected with limited functionality?

Unfortunately thats the current state of it. It looks like all the commands have changed.

jb123567 commented 10 months ago

@TomG736 okay, how can I help?

TomG736 commented 10 months ago

Give me a few days to poke around with it and I'll let you know how it goes.

jb123567 commented 10 months ago

Give me a few days to poke around with it and I'll let you know how it goes.

Looking great already, the states seem to be working now!!

MerekW commented 10 months ago

I'm seeing the reported behavior on a new vacuum/install into HA today. Please let me know if I can test any available fixes, and thank you so much for all your contributions!

jb123567 commented 9 months ago

@CodeFoodPixels is the L60 supported within the latest releases? I'm getting an error


2024-03-01 19:50:50.635 ERROR (MainThread) [homeassistant.components.vacuum] Error while setting up robovac platform for vacuum

Edited with full error


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/robovac/vacuum.py", line 128, in async_setup_entry
    entity = RoboVacEntity(item)
             ^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/robovac/vacuum.py", line 296, in __init__
    self._attr_supported_features = self.vacuum.getHomeAssistantFeatures()
                                    ^^^^^^^^^^^
AttributeError: 'RoboVacEntity' object has no attribute 'vacuum'
jb123567 commented 8 months ago

Give me a few days to poke around with it and I'll let you know how it goes.

Did you get anywhere? The coding is way beyond me!!

TomG736 commented 8 months ago

I haven't had much more time to look at it. I'm not sure on the next steps to get the controls working. I may work more on some of the status reporting and getting it in a state that could be merged back in to the rest of the project.

CodeFoodPixels commented 8 months ago

So I've been working on a new branch better-dps that gives each vacuum it's own file to define the command codes. If you run this repo, you'll get a JSON blob of the schema, which contains the commands.

TomG736 commented 8 months ago

How well tested is that branch? Is it worth me making a config for the L60 off it or is it too early to test it out?

That python code worked a dream. Would have been much easier than my original method of trawling through the logs and matching the log output to the robot behaviour.

CodeFoodPixels commented 8 months ago

There are definitely some things I still need to do, but I've been running it for like a week now with no issues

On Tue, 12 Mar 2024, 21:40 Tom Grant, @.***> wrote:

How well tested is that branch? Is it worth me making a config for the L60 off it or is it too early to test it out?

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

DellBoy4 commented 8 months ago

Now i have updated beyond the version i was on which was old (1.1.1) my X8 has stopped working and now only shows the battery entity but as unavailable. My L60 also doesn't work and shows the same 1 entity. I have tried downgrading but unless i do a restore of HA back to that version i cannot get even the X8 to pick up. I have also tried it on a fresh install of HA and get the same behaviour. I saw a comment on another issue about trying the DPS builds but i get the same thing. Any ideas?

jbleyaert commented 8 months ago

Now i have updated beyond the version i was on which was old (1.1.1) my X8 has stopped working and now only shows the battery entity but as unavailable. My L60 also doesn't work and shows the same 1 entity. I have tried downgrading but unless i do a restore of HA back to that version i cannot get even the X8 to pick up. I have also tried it on a fresh install of HA and get the same behaviour. I saw a comment on another issue about trying the DPS builds but i get the same thing. Any ideas?

The L60 is not (yet) supported, not in the main branch and not in the better-dps branch.

DellBoy4 commented 8 months ago

I get that but why would that stop the X8 that was working working and remove all the entities for it bar the battery which shows as unavailable?

CodeFoodPixels commented 8 months ago

@DellBoy4 try the latest version,

DellBoy4 commented 8 months ago

Hi, I tried the latest build 1.2.10 and had the same issue. Also tried it on a fresh install not having the integration installed before and get the same thing. I get this error repeatedly.

2024-03-22 07:41:09.760 ERROR (MainThread) [homeassistant.components.vacuum] Error while setting up robovac platform for vacuum
File "/config/custom_components/robovac/vacuum.py", line 116, in async_setup_entry
entity = RoboVacEntity(item)
File "/config/custom_components/robovac/vacuum.py", line 284, in __init__
AttributeError: 'RoboVacEntity' object has no attribute 'vacuum'

If im being stupid and something has changed that I've missed please let me know, thanks.

Mint514 commented 8 months ago

Just commenting to follow & say that if you need someone to test with an L60 - Happy to do so. Just bought one without doing research into the integration side of things (lame!) Keep up the awesome work all.

Pieterv24 commented 8 months ago

Am currently trying to get the L60 H SES (T2278) to work. Still having some issues though. Will make a PR once I seem to have a working integration. (workin on the better-dps branch)

jbleyaert commented 8 months ago

Am currently trying to get the L60 H SES (T2278) to work. Still having some issues though. Will make a PR once I seem to have a working integration. (workin on the better-dps branch)

I actually tried to get the T2277 to work (L60 SES), but failed. I got battery and "locate" working, but that's about it. I will pick it up again when I have more time. Maybe we can check together? This is the PR. https://github.com/CodeFoodPixels/robovac/pull/66

VictoriousCupid commented 8 months ago

I've got the L60 SES (T2277) and no skills in coding, I'm good at copying, pasting and testing though. So that is what I can offer. Tag me if those "skills" come in handy.

TomG736 commented 8 months ago

The L60 uses a different encoding for the status updates, I have a loosely working version of it but I have been unable to decode the exact content of the dps messages. I have something which will roughly give you the current status, battery and locate works. Simply using the current version with the codes updated for the L60 will not work.

Pieterv24 commented 8 months ago

The L60 uses a different encoding for the status updates, I have a loosely working version of it but I have been unable to decode the exact content of the dps messages. I have something which will roughly give you the current status, battery and locate works. Simply using the current version with the codes updated for the L60 will not work.

Good to know. Any guesses of how the dps values are encoded?

TomG736 commented 8 months ago

They are all base64 encoded bytestrings. How to decode the bytes is the challenge. Currently Im looking for these bytestrings in the status dps:

        RobovacCommand.STATUS: {
            # there is far more to this field!
            "code": 153,
            "values": {
                b"\x10\x052\x00": "Cleaning",
                b"\x10\x052\x02\x08\x01": "Paused",
                b"\x10\x07B\x00": "Recharge",
                b"\x10\x03\x1a\x00": "Charging",
                b"\x10\x03\x1a\x02\x08\x01": "completed",
                b"\x10\x04*\x00": "QuickMapping",
                b"\x10\x05R\x00": "standby",  # Locating?
            },
        },

This is a bit of a dumb way of doing it as it doesnt actually decode the information but it does seem to be working for now.

On the schema you can see a lot of them have a 'raw' type which means they are base64 encoded bytestrings.

CodeFoodPixels commented 8 months ago

@TomG736 from looking at a decompiled version of the app, it looks like it uses protobuf

CodeFoodPixels commented 8 months ago

So I found the protobuf definitions and generated a python interface for the work status. It looks like it works! Pushed it into a gist here: https://gist.github.com/CodeFoodPixels/3ff6c153df08901b6819a25e9b9c50d0

TomG736 commented 8 months ago

I have just tested some cached values I have, the first byte is a length byte then the rest is correctly decoded by that protobuf.

Examples ``` Key: 153 2024-03-31 08:29:20.686970+00:00 06 0a 00 10 05 32 00 || b'\x06\n\x00\x10\x052\x00' mode { } state: CLEANING cleaning { } 2024-03-31 08:29:25.575711+00:00 06 0a 00 10 05 52 00 || b'\x06\n\x00\x10\x05R\x00' mode { } state: CLEANING relocating { } 2024-03-31 08:29:28.426625+00:00 06 0a 00 10 05 32 00 || b'\x06\n\x00\x10\x052\x00' mode { } state: CLEANING cleaning { } 2024-03-31 08:51:28.044874+00:00 04 10 07 42 00 || b'\x04\x10\x07B\x00' state: GO_HOME go_home { } 2024-03-31 08:52:14.321994+00:00 04 10 03 1a 00 || b'\x04\x10\x03\x1a\x00' state: CHARGING charging { } 2024-03-31 10:32:32.879378+00:00 06 10 03 1a 02 08 01 || b'\x06\x10\x03\x1a\x02\x08\x01' state: CHARGING charging { state: DONE } 2024-03-31 14:58:32.597083+00:00 08 0a 02 08 02 10 05 32 00 || b'\x08\n\x02\x08\x02\x10\x052\x00' mode { value: SELECT_ZONE } state: CLEANING cleaning { } 2024-03-31 14:58:36.700443+00:00 08 0a 02 08 02 10 05 52 00 || b'\x08\n\x02\x08\x02\x10\x05R\x00' mode { value: SELECT_ZONE } state: CLEANING relocating { } 2024-03-31 14:58:39.781104+00:00 08 0a 02 08 02 10 05 32 00 || b'\x08\n\x02\x08\x02\x10\x052\x00' mode { value: SELECT_ZONE } state: CLEANING cleaning { } 2024-03-31 15:00:55.145192+00:00 04 10 07 42 00 || b'\x04\x10\x07B\x00' state: GO_HOME go_home { } 2024-03-31 15:01:23.701433+00:00 04 10 03 1a 00 || b'\x04\x10\x03\x1a\x00' state: CHARGING charging { } 2024-03-31 15:03:51.769760+00:00 06 10 03 1a 02 08 01 || b'\x06\x10\x03\x1a\x02\x08\x01' state: CHARGING charging { state: DONE } ```
CodeFoodPixels commented 8 months ago

Do these byte strings come through the dps dict that the current tuyalocalapi.py provides?

TomG736 commented 7 months ago

Do these byte strings come through the dps dict that the current tuyalocalapi.py provides?

Yes, here I have create an attribute which will display all the dps keys and values. My HA instance exports all its data to influx so I can then access all these states and how they have changed over time.

VictoriousCupid commented 7 months ago

Any progress in this? If possible and or needed, can I help in any way?

john500y2k commented 6 months ago

Do these byte strings come through the dps dict that the current tuyalocalapi.py provides?

Yes, here I have create an attribute which will display all the dps keys and values. My HA instance exports all its data to influx so I can then access all these states and how they have changed over time.

I think you may be on to something. Just tried your repo versions and had a touch of success specifically with version L60_V3.0 on my X9 Pro (screenshot below). None of the commands work and it seems to only report those values when a clean is in progress. Never manages to pull them when it is just docked and idle with the exception of battery level

IMG_1450

IainPHay commented 6 months ago

Just got an L60 and would love to see this working, all the comments before are a little beyond me though!

ddakotac commented 4 months ago

Also just got an L60 and would love to see it supported. Happy to test anything out and report back, and thanks for the work on this integration

maximoei commented 4 months ago

Got some success with my L60 SES https://github.com/CodeFoodPixels/robovac/issues/85#issuecomment-2249935438