Eufy Robovac 35c Working with Home_Assistant - Updated 11/2020 - How To Guide - Now with Edge Cleaning!

I have the 30c and this custom component has never fully worked - despite acquiring the “access_token” and “id” numerous times through ADB. I never get a status other than ‘error’ and the battery indicator is either ‘?’ or once in a while shows the correct value.

My log errors have consistently been:

Failed to decrypt message from 6030385************* (192.168..:6668)
“utf-8” codec can’t decode byte 0x89 in position 4: invalid start byte

I can start a cleaning cycle from the custom card - but that’s about it.

I have carefully been through the installation at least 7 or 8 times now and the result is always the same.

Edit: Wrong Model Number

Great work! I’ve learned a lot so far just following this through but like a few others, I’ve ended up stuck so I’ll try and be as clear as I can.

I have a ‘custom_components’ folder that I created a folder called ‘eufy_vacuum’ in and then dropped the contents of ‘eufy_robovac’ into. I did the (3, 1) tweak as referenced in the comments.

I couldn’t figure out where to run the ‘installation’ section of that link; the instruction of WHAT to do are clear but not WHERE to do it. Should it be run in the ‘eufy_vacuum’ folder?

I got the Device ID and Local Key from following the tutorial and also checked and rechecked them. They are in the code section in my configuration.yaml file.

I’m using a static IP for the Eufy 15C. The model number from the JSON file returned by ADB is T2120 but I left all the code set to T2118 as nothing suggested that needed to be changed.

Restarted Home Assistant from Configuration>Server Controls>Restart. Expected HA to find the vacuum when it restarted but instead I just get this error in the logs:

Logger: homeassistant.components.vacuum
Source: custom_components/eufy_vacuum/tuya.py:482
Integration: Vacuum (documentation, issues)
First occurred: 10:16:00 AM (1 occurrences)
Last logged: 10:16:00 AM

eufy_vacuum: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    await task
  File "/config/custom_components/eufy_vacuum/vacuum.py", line 75, in async_update
    await self.robovac.async_get()
  File "/config/custom_components/eufy_vacuum/tuya.py", line 506, in async_get
    return await message.async_send(self, callback)
  File "/config/custom_components/eufy_vacuum/tuya.py", line 352, in async_send
    await device._async_send(self)
  File "/config/custom_components/eufy_vacuum/tuya.py", line 571, in _async_send
    await self.async_connect()
  File "/config/custom_components/eufy_vacuum/tuya.py", line 482, in async_connect
    sock.connect((self.host, self.port))
OSError: [Errno 113] Host is unreachable

Any ideas or suggestions?

I can control the vacuum from the app so it is on the network and working OK. Home Assistant doesn’t discover the device at all. The DHCP server has a hostname of ESP_(last 6 digits of MAC) for the device.

EDIT:
Tested by reverting the tweak to (3, 3) with no difference.
Firmware is:

  • WiFi: 1.1.1
  • MCU: 1.1.4

So, here is a thought; is anyone that has this working using the Nabu Casa Home Assistant cloud? I’m starting to think that this is less an issue with the custom component and more to do with the networking used through the cloud.

I can ping the vacuum from the firewall interface (Untangle) but not from the HA terminal. Nothing in the firewall logs suggesting it is blocking traffic AND the app still works so whatever traffic is going through teh firewall to make that work is working. The rest of HA works via the cloud - lights, switches, sensors etc - so it has comms through the firewall for that OK. I can see a case where ICMP traffic may be blocked and even though it should be logged, it may not be but that still doesn’t explain why the custom component for the vacuum cannot see the vacuum on the same network.

Finally got it working after more than a month of trying.

Eventually, I did a hard reset of my Eufy Robovac 30c - and went through setting it up from scratch. Usinf ADB, the ID remained the same, but the access-token changed and I amended my configuration.yaml to include the new value.

Once I had restarted Home Assistant, I am now able to see the status and battery percentage properly.

Nothing less than a full reset allowed me to get this going - so i would recommend anyone who is having trouble with this custom component to do this first.

Good to know. I may try this later today. Do the controls, and services work? Like Start, Stop?

Yes, all the controls work. I’d never been able to see the status before - it always said ‘error’ - and the battery indicator only worked intermittently.

No idea why a full reset of the Robovac worked. I’d been putting it off for a long time - but I’m glad I did a hard reset.

The only thing I had to change in Home Assistant was the new access token - all worked after that.

I also no longer get any errors in the log.

Thank you! That did the trick for me as well.

Few Notes:

  1. I did not use the tuya.ph update on line 438 to (3,1). I used the original (3,3).
  2. I had tried the Edge directory at one point during my previous testing, and that did not work.

After reverting my directory to the OG post info, doing a hard reset to get a new access code, I am all good to go.

Is there a way to add this integration without messing with adb and an android device or blue stacks?

I’ve seen this here which seems to get the details with just a username and password.

Looking for some advice please. Try as I might, I can’t seem to get this integration to properly function with my two G30 Edge RoboVacs (named Lilo and Stitch :slight_smile: ). Both devices are physically seen within HA, however they’re not working as expected.

So far I’ve tried the following

  1. Followed the instructions in post 1 (using Bluestacks and the Eufy 2.3.2 apk). (See yaml at the end of this post for final config)
  2. Double checked instructions against the ones found at https://github.com/RoldyBuffalo/eufy_robovac_edge_clean (note, the services don’t show up as outlined in the post)
  3. Issued a hard reset on both Vacuums and re-added (as per previous advice)

Both vacuums are seen within HA

and can be manually operated, but both display errors when selected.

image

Issuing any command generates a ValueError: 0 is not a valid ErrorCode response. Full log is below.

Logger: homeassistant
Source: custom_components/eufy_vacuum/property.py:36
First occurred: 14:49:50 (9 occurrences)
Last logged: 14:52:30
Error doing job: Task exception was never retrieved

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 621, in _update_entity_states
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 282, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 321, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/vacuum/__init__.py", line 277, in state_attributes
    data = super().state_attributes
  File "/usr/src/homeassistant/homeassistant/components/vacuum/__init__.py", line 178, in state_attributes
    data[ATTR_BATTERY_ICON] = self.battery_icon
  File "/usr/src/homeassistant/homeassistant/components/vacuum/__init__.py", line 268, in battery_icon
    if self.status is not None:
  File "/config/custom_components/eufy_vacuum/vacuum.py", line 116, in status
    if self.robovac.error_code != robovac.ErrorCode.NO_ERROR:
  File "/config/custom_components/eufy_vacuum/property.py", line 36, in __get__
    value = self.type_cast(value)
  File "/usr/local/lib/python3.8/enum.py", line 339, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.8/enum.py", line 662, in __new__
    raise ve_exc

ValueError: 0 is not a valid ErrorCode

Configuration files as below, which allow both devices to be seen (so have assumed that is ok).

vacuum:
- platform: eufy_vacuum

plus

eufy_vacuum:
  devices:
  - name: Lilo
    address: !secret EufyIP_01
    id: !secret EufyDevID_01
    access_token: !secret EufyLocalKey_01
    type: T2118
  - name: Stitch
    address: !secret EufyIP_02
    id: !secret EufyDevID_02
    access_token: !secret EufyLocalKey_02
    type: T2118

Obviously the G30’s (or Edge variant) may not be fully supported, but if anyone has one working, would be good to know how you did it.

The only thing I would say is that the Eufy G30 Edge has a model number of: T2251 rather than T2118 - perhaps this has something to do with it maybe?

Yup, am aware of the different model number, but the code only allows for T2118 as a valid entry (any other results in the module not working at all)

See here for the code

1 Like

My G30 is actually 2252 so there are likely different generations or regions at play with regards to the model number.

Hi guys,

I just wanted to point everyone to my repo which you can import into HACS and has all the bits needed to keep on working after 2021.6 comes along.

I’m not claiming any credit for writing this code. It’s based off of the two projects mentioned in OPs instructions and forked off of eufy_vacuum by snopeonarope.

I’ll try to see if I can help out with any of the other people attempting to use this with their different model Robovacs. I only have 1 - a 30c or 35c (not sure which one) but I got it working with OPs instructions. I have found some interesting bits of code that I am going to see how I can incorporate it which means we won’t need to get the code from the Eufy App, etc. (Someone posted this above as well - @eximo84 - thanks for that.)

And, if anyone else wants to help with this, please feel free to contribute. That’s what Open Source is all about right?

I’m not sure what I need to do to have this show in HACS as a new repo (maybe it picks is up automatically) but you can import it as a repository if you go into Integrations and click on the 3 dots → add repository.

Any comments, suggestions are welcome! And as with a lot of projects, I’m doing this in my spare time. (Early in the morning or late in the afternoon UK time.)

Enjoy!


Patrick

5 Likes

From what I can tell the G30 models are coded as follows

T2250 = G30 (no edge detection)
T2251 = G30 Edge (comes with 2 boundary strips)
T2252 = G30 Verge (same specs as T2251, but only comes with 1 boundary strip)
T2253 = G30 Hybrid (mops & vacuums, comes with 1 boundary strip)

1 Like

I started investigating further and these are the models I’ve found.

Models / Number
G30 Hybrid T2253
G30 Edge T2251
G30 T2250
G10 Hybrid T2150
30C Max T2130
15C Max T2128
15C White T2120
11S Plus T2119
30C T2118
35C T2117
30 T2116 - remote only
11S MAX T2126 - remote only
11S T2108 - remote only
25C T2123
11C T2103
12 T2109 - remote only

Obviously, the ones with remote only can’t work with this. But I listed them for completeness.

Some are listed in the UK pages, others in the US pages. I’m sure there are models elsewhere that I haven’t put in here. I mainly want to figure what each one does and see how I can build this integration to cover as many models as possible.

3 Likes

Many thanks to Patrick - I now have something that mostly works instead of nothing at all.

p4mr: I’ve added a few comments on the Github issue you raised. Commenting a few lines out of one file and modifying another line should get Lilo and Stitch working a little better for you - Link. It has worked well with Puck the G30 at least.

Thanks for all the additional work. I’ve got an additional fix that I need to address so I’ll see what you’ve changed and add it to the code. Did you do a pull request? Nevermind - I can just check.

Thanks!

-P

Just commenting out the troublesome part - not worth a PR, needs fixing properly :slight_smile:

Looking forward to seeing what you’ve done.

Great work! It would be great if you were able to implement the battery info so that it works on HomeKit. I submitted an enhancement request last year to the original git

I’m trying to setup my Eufy Robavac C35 to HA, But I am struggling to get the device_id and de Local_key. I used a Samsung A20e and Bluestack but I did succeed yet.

I used adb logcat and searched for the id and key I found the key but did succeed to find the local_Key. If I search for local_code the value is empty

I tried multiple versions of the app 2.3.1/2.3.2/2.4.0.

Output (*** == hide value) (### == find the device id here)

OkHttp : {"res_code":1,"message":"","devices":[{"id":"(###","sn":"","name":"35C","alias_name":"***","bluetooth":null,"wifi":{"mac":"E0:98:06:06:20:0A","wifi_ssid":"***","lan_ip_addr":"***"},"product":{"id":"cbbebfbb-67f5-11e8-a09e-0242ac130017","name":"35C","region":"US","default_name":"RoboVac","icon_url":"https://d1teb1w17vl5yo.cloudfront.net/eufyhome/products/T2117_addProduct.png","category":"Home","appliance":"Cleaning","connect_type":1,"pictures":[{"code":"addProductIcon","url":"https://d1teb1w17vl5yo.cloudfront.net/eufyhome/products/T2117_addProduct.png","description":""},{"code":"selectDeviceImage","url":"https://d1teb1w17vl5yo.cloudfront.net/eufyhome/products/T2117_selectProduct.png","description":""},{"code":"feedbackImage","url":"https://d1teb1w17vl5yo.cloudfront.net/eufyhome/products/T2117_feedback.png","description":""}],"description":"T2117 RoboVac 35C, connected via EufyHome","product_code":"T2117","wifi_ssid_prefix":"eufy RoboVac 35C","wifi_ssid_prefix_full":"eufy RoboVac 35C-","index":15,"create_time":1493114110,"update_time":1528774126,"is_show":false,"tuya_pid":""},"user_id":"***","owner_info":null,"home_id":"a0c216eb-f229-4576-aeae-1cd520ce43f1","home_name":"","room_id":"***","room_name":"***Room","connect_type":1,"grant_by":0,"software_version":"1.1.5","index":0,"device_key":"","create_time":1626370028,"update_time":***,"hardware_version":"","local_code":"","needUpdate":false,"setting":{"id":"","device_id":"","is_default":true},"update_packages":[]}],"groups":[]}

It took me quite a long time to get right - it’s fiddly.

The first point is that you need to use Eufy Home Android 2.3.2 - later versions will not work because the JSON isn’t logged anymore - but I can see that you have tried that at least.

I used the ADB tools from xda-developers to connect to my phone. I didn’t use Bluestacks. The platform-tools and instructions for Windows 10 are here:

I used the command: adb logcat -e 'tuya.m.my.group.device.list’

This actually didn’t produce any output on screen until I had written out the logfile using:

adb logcat -d > myfile

where ‘myfile’ is whatever filename you want. If you find that you can’t use the ‘-e’ option for whatever reason, the logfile will write to the screen and you can then cut and paste the log to Notepad or NotePad++

I’ve used this method 3-4 times and it took a lot of trial and error to get the output containing the keys.

The ‘LocalKey’ is 16 characters long, the ‘devID’ is 21 characters long.

I have my RoboVac within HA and all the functions work perfectly - so it’s definitely worth doing.

2 Likes