mitchellrj / eufy_robovac

Other
105 stars 52 forks source link

Support for 15c (T2120) #12

Open rmountjoy92 opened 4 years ago

rmountjoy92 commented 4 years ago

Hello, I've done a bunch of research on how to control the Robovac 15c (T2120) with home assistant and I keep getting pointed to here. I have gotten the localKey and devId from the abd commands - which was quite easy. But when I run the demo I get:

DEBUG:asyncio:Using selector: EpollSelector DEBUG:eufy_robovac.tuya:Connecting to 66878020807d3a3b614b (192.168.39.139:6668) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0x9, b'', 0, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0xa, {'gwId': '66878020807d3a3b614b', 'devId': '66878020807d3a3b614b'}, 405717436, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) ERROR:eufy_robovac.tuya:Connection to 66878020807d3a3b614b (192.168.39.139:6668) failed: [Errno 104] Connection reset by peer DEBUG:eufy_robovac.tuya:Disconnected from 66878020807d3a3b614b (192.168.39.139:6668) Starting cleaning... DEBUG:eufy_robovac.tuya:Connecting to 66878020807d3a3b614b (192.168.39.139:6668) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0x7, {'devId': '66878020807d3a3b614b', 'uid': '', 't': 1579179104, 'dps': {'5': 'auto'}}, 405718437, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0x9, b'', 0, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0xa, {'gwId': '66878020807d3a3b614b', 'devId': '66878020807d3a3b614b'}, 405718447, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) ERROR:eufy_robovac.tuya:Connection to 66878020807d3a3b614b (192.168.39.139:6668) failed: [Errno 104] Connection reset by peer DEBUG:eufy_robovac.tuya:Disconnected from 66878020807d3a3b614b (192.168.39.139:6668) Pausing... DEBUG:eufy_robovac.tuya:Connecting to 66878020807d3a3b614b (192.168.39.139:6668) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0x7, {'devId': '66878020807d3a3b614b', 'uid': '', 't': 1579179109, 'dps': {'2': False}}, 405723453, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0x9, b'', 0, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0xa, {'gwId': '66878020807d3a3b614b', 'devId': '66878020807d3a3b614b'}, 405723461, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) ERROR:eufy_robovac.tuya:Connection to 66878020807d3a3b614b (192.168.39.139:6668) failed: [Errno 104] Connection reset by peer DEBUG:eufy_robovac.tuya:Disconnected from 66878020807d3a3b614b (192.168.39.139:6668) Disconnecting... DEBUG:eufy_robovac.tuya:Disconnected from 66878020807d3a3b614b (192.168.39.139:6668)

I ran nmap on the IP and it is the correct IP and port 6668 is open. Any ideas of where the problem might be coming from? I'm gonna keep trying to figure it out (mainly because these things dropped to $80 open box from amazon and I bought 3 of them lol) but if someone could point me in the right direction it would be much appreciated!

edit: When I force closed the Eufy app and reran the demo, the output looked like this: DEBUG:asyncio:Using selector: EpollSelector DEBUG:eufy_robovac.tuya:Connecting to 66878020807d3a3b614b (192.168.39.139:6668) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0x9, b'', 0, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0xa, {'gwId': '66878020807d3a3b614b', 'devId': '66878020807d3a3b614b'}, 605228873, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) DEBUG:eufy_robovac.tuya:Received message from 66878020807d3a3b614b (192.168.39.139:6668): Message(0x9, b'', 0, None) DEBUG:eufy_robovac.tuya:6461746120666f726d6174206572726f72 ERROR:eufy_robovac.tuya:Expecting value: line 1 column 1 (char 0) ERROR:eufy_robovac.tuya:Failed to decrypt message from 66878020807d3a3b614b (192.168.39.139:6668) Starting cleaning... DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0x7, {'devId': '66878020807d3a3b614b', 'uid': '', 't': 1579180817, 'dps': {'5': 'auto'}}, 605229875, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) Pausing... DEBUG:eufy_robovac.tuya:Sending to 66878020807d3a3b614b (192.168.39.139:6668): Message(0x7, {'devId': '66878020807d3a3b614b', 'uid': '', 't': 1579180822, 'dps': {'2': False}}, 605234880, <Device 66878020807d3a3b614b (192.168.39.139:6668)>) Disconnecting... DEBUG:eufy_robovac.tuya:Disconnected from 66878020807d3a3b614b (192.168.39.139:6668) Just to see, I put the custom component into HA, here's what it looks like (note: I had to leave the model as T2118 because if I put T2120 it says 'unsupported model' and doesn't load at all into HA): image

None of the buttons do anything

Here's the logs from HA: image

rmountjoy92 commented 4 years ago

Update: For some reason, if you change the TuyaDevice default version to (3, 1) in line 438 of tuya.py it magically works 100%.

scoobypt commented 4 years ago

Thanks a lot that change on the tuya.py work on my 35C. I was looking for a fix for weeks now never had been able to make it work with home assistant till now.

aptonline commented 4 years ago

I'm trying to do the same for the RoboVac 15C MAX but the above change doesn't seem to work. Any ideas?

aptonline commented 4 years ago

getting the following error:

  File "/config/custom_components/eufy_vacuum/__init__.py", line 17, in <module>
    from .robovac import Robovac
  File "/config/custom_components/eufy_vacuum/robovac.py", line 20, in <module>
    from .tuya import TuyaDevice
  File "/config/custom_components/eufy_vacuum/tuya.py", line 438
    gateway_id=None, version=(3, 1, timeout=10):
                                           ^
SyntaxError: invalid syntax

EDIT: The demo works as expected.

lennartgrunau commented 3 years ago

Leaving the model as T2118 and making the changes to tuya.py proposed by @rmountjoy92 made it work on my side with the 15C on WiFi Version 1.1.1 and MCU Version 1.1.4 on the 15C. Thanks a ton!

mitchellrj commented 3 years ago

If anyone wants to submit a pull-request to make this more easily configurable, I'd gladly accept it.

clarkd commented 3 years ago

getting the following error:

  File "/config/custom_components/eufy_vacuum/__init__.py", line 17, in <module>
    from .robovac import Robovac
  File "/config/custom_components/eufy_vacuum/robovac.py", line 20, in <module>
    from .tuya import TuyaDevice
  File "/config/custom_components/eufy_vacuum/tuya.py", line 438
    gateway_id=None, version=(3, 1, timeout=10):
                                           ^
SyntaxError: invalid syntax

EDIT: The demo works as expected.

@aptonline You have a typo, the line should read:

gateway_id=None, version=(3, 1), timeout=10):

clarkd commented 3 years ago

FYI - I just set up the configuration and it did not working using Tuya (3,1). Reverting back to (3,3) works as expected.

Sloshmold commented 2 years ago

Hi all,

my turn to try get this working, i have tried all the above and still no luck! even tried higher versions.

'utf-8' codec can't decode byte 0xda in position 3: invalid continuation byte' this is what shows up in the log

Anyone else recently done the integration?

thanks

h4nnes commented 1 year ago

Hi all,

my turn to try get this working, i have tried all the above and still no luck! even tried higher versions.

'utf-8' codec can't decode byte 0xda in position 3: invalid continuation byte' this is what shows up in the log

Anyone else recently done the integration?

thanks

After I removed line 116,117,118 and updated 119 in the vacuum.py my G10 is working now

But I get following error. Did you manage to solve the docoding error? [custom_components.eufy_vacuum.tuya] 'utf-8' codec can't decode byte 0x86 in position 3: invalid start byte [custom_components.eufy_vacuum.tuya] Failed to decrypt message from xxx