mitchellrj / eufy_robovac

Other
105 stars 52 forks source link

Unable to decrypt message on latest release #8

Open Joeboyc2 opened 4 years ago

Joeboyc2 commented 4 years ago

Hey @mitchellrj ,

Using the latest release i cant seem to get my robovac to work, (i previously had it working on firmware 1.1.1 but the vac updated itself :( and it stopped working so i have been waiting for this new version)

The error im getting is this: 2019-09-07 23:13:19 ERROR (MainThread) [custom_components.eufy_vacuum.tuya] 'utf-8' codec can't decode byte 0x95 in position 0: invalid start byte 2019-09-07 23:13:19 ERROR (MainThread) [custom_components.eufy_vacuum.tuya] Failed to decrypt message from 10050101807d3a60099a (192.168.86.207:6668)

The vac has been added to HA and the entity is showing, but i'm unable to trigger anything or see the state

Joeboyc2 commented 4 years ago

when running the demo i get the following output: pi@raspberrypi:~/eufy_robovac $ bin/demo 10050101807d3a60099a 192.168.86.207 UceA1fpIZIAySN6U DEBUG:asyncio:Using selector: EpollSelector DEBUG:eufy_robovac.tuya:Connecting to 10050101807d3a60099a (192.168.86.207:6668) DEBUG:eufy_robovac.tuya:Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0x9, b'', 0, <Device 10050101807d3a60099a (192.168.86.207:6668)>) DEBUG:eufy_robovac.tuya:Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0xa, {'gwId': '10050101807d3a60099a', 'devId': '10050101807d3a60099a'}, 1615041565, <Device 10050101807d3a60099a (192.168.86.207:6668)>) ERROR:eufy_robovac.tuya:Connection to 10050101807d3a60099a (192.168.86.207:6668) failed: [Errno 104] Connection reset by peer DEBUG:eufy_robovac.tuya:Disconnected from 10050101807d3a60099a (192.168.86.207:6668) Starting cleaning... DEBUG:eufy_robovac.tuya:Connecting to 10050101807d3a60099a (192.168.86.207:6668) DEBUG:eufy_robovac.tuya:Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0x7, {'devId': '10050101807d3a60099a', 'uid': '', 't': 1567937653, 'dps': {'5': 'auto'}}, 1615042566, <Device 10050101807d3a60099a (192.168.86.207:6668)>) DEBUG:eufy_robovac.tuya:Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0x9, b'', 0, <Device 10050101807d3a60099a (192.168.86.207:6668)>) DEBUG:eufy_robovac.tuya:Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0xa, {'gwId': '10050101807d3a60099a', 'devId': '10050101807d3a60099a'}, 1615042797, <Device 10050101807d3a60099a (192.168.86.207:6668)>) ERROR:eufy_robovac.tuya:Connection to 10050101807d3a60099a (192.168.86.207:6668) failed: [Errno 104] Connection reset by peer DEBUG:eufy_robovac.tuya:Disconnected from 10050101807d3a60099a (192.168.86.207:6668) Pausing... DEBUG:eufy_robovac.tuya:Connecting to 10050101807d3a60099a (192.168.86.207:6668) DEBUG:eufy_robovac.tuya:Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0x7, {'devId': '10050101807d3a60099a', 'uid': '', 't': 1567937658, 'dps': {'2': False}}, 1615047801, <Device 10050101807d3a60099a (192.168.86.207:6668)>) DEBUG:eufy_robovac.tuya:Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0x9, b'', 0, <Device 10050101807d3a60099a (192.168.86.207:6668)>) DEBUG:eufy_robovac.tuya:Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0xa, {'gwId': '10050101807d3a60099a', 'devId': '10050101807d3a60099a'}, 1615047919, <Device 10050101807d3a60099a (192.168.86.207:6668)>) ERROR:eufy_robovac.tuya:Connection to 10050101807d3a60099a (192.168.86.207:6668) failed: [Errno 104] Connection reset by peer DEBUG:eufy_robovac.tuya:Disconnected from 10050101807d3a60099a (192.168.86.207:6668) Disconnecting... DEBUG:eufy_robovac.tuya:Disconnected from 10050101807d3a60099a (192.168.86.207:6668)

The most obvious issue i can see is the message saying: "failed: [Errno 104] Connection reset by peer" but im not sure why i would be getting that :(

Joeboyc2 commented 4 years ago

so it look like i had my "localkey" wrong, updating it to the one i found in the logcat i now get a different error: 2019-09-08 11:36:19 ERROR (MainThread) [custom_components.eufy_vacuum.tuya] 'utf-8' codec can't decode byte 0xed in position 8: invalid continuation byte 2019-09-08 11:36:19 ERROR (MainThread) [custom_components.eufy_vacuum.tuya] Failed to decrypt message from 10050101807d3a60099a (192.168.86.207:6668) 2019-09-08 11:36:19 DEBUG (MainThread) [custom_components.eufy_vacuum.tuya] Received message from 10050101807d3a60099a (192.168.86.207:6668): Message(0x9, b'', 0, None)

These are the messages that show up in the log before those above: 2019-09-08 11:36:19 DEBUG (MainThread) [custom_components.eufy_vacuum.tuya] Connecting to 10050101807d3a60099a (192.168.86.207:6668) 2019-09-08 11:36:19 DEBUG (MainThread) [custom_components.eufy_vacuum.tuya] Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0xa, {'gwId': '10050101807d3a60099a', 'devId': '10050101807d3a60099a'}, 870778092, <Device 10050101807d3a60099a (192.168.86.207:6668)>) 2019-09-08 11:36:19 DEBUG (MainThread) [custom_components.eufy_vacuum.tuya] Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0x9, b'', 0, <Device 10050101807d3a60099a (192.168.86.207:6668)>) 2019-09-08 11:36:19 DEBUG (MainThread) [custom_components.eufy_vacuum.tuya] Sending to 10050101807d3a60099a (192.168.86.207:6668): Message(0xa, {'gwId': '10050101807d3a60099a', 'devId': '10050101807d3a60099a'}, 870778147, <Device 10050101807d3a60099a (192.168.86.207:6668)>) 2019-09-08 11:36:19 DEBUG (MainThread) [custom_components.eufy_vacuum.tuya] 07033032421dd1b8ed5e351e1266c16376cf2f86aea96ce4b1d43f634d6a54c74b9d193c1875a15ce03c861415628e38c286f8bd02583b3503c06bfa516f621dea9db6c9eb9486fe0fbe9ca7446d19fc418d9af5f395ab023ceec1ee5152545768ead222d2a65de81f6716cda1546e09e32614c6009e0b940502041f10879c12612e5eac6af5b0680751c6eb0ba0ba3d426db886304216dedc1c11ce7e7dde3281c2ae4ba4f1de04cb40e8de7ded58c1

Joeboyc2 commented 4 years ago

After doing some more testing I've found that the functions in the component do actually work (despite the errors in the log), it looks like the errors might be coming from the status requests as it shows 'error' in the component window image

mitchellrj commented 4 years ago

The same status request gives you the battery percentage, which looks OK. The "error" status should only show if there is an error with the device itself - does the app show an error? like "bumper stuck", that kind of thing?

The logs do also show some errors decoding messages, so I'll leave this open to track that if other users encounter it too.

Joeboyc2 commented 4 years ago

oh thats odd as its not in an error state currently, its charging but as everything else is working i'm happy with that, hopefully the error is something that can be ironed as its filling up my log lol

silviudc commented 4 years ago

I am having the same issue with a 15C Max, error status but the functions do work. I am getting this in the logs:

2019-12-08 21:53:59 DEBUG (MainThread) [custom_components.eufy_vacuum.tuya] 1f39244acff59db0fae834ef3e1de9a04f69109c4dbe15867483eb01ed3e5ed866eeaa34703eee9a25de536888b5adce419b8325e27d21a5f27859dc97020f4ec879cb7a3553062d82dbb2022d482234d5b4d7163c8afab0b68be741109c12cac53bc7344639ffd564b22117c538ffd9914d7ce37cc0a128929140ad9ea6760526423d93d866a4b110dc73cb83df071ebf1ef82f46cde1fb1cbab09135f338d7cfd0d3bd1ea080257d41517acd8fa13a

2019-12-08 21:53:59 ERROR (MainThread) [custom_components.eufy_vacuum.tuya] 'utf-8' codec can't decode byte 0xcf in position 4: invalid continuation byte

2019-12-08 21:53:59 ERROR (MainThread) [custom_components.eufy_vacuum.tuya] Failed to decrypt message from 0753038684f3ebxxxxxx (192.168.0.43:6668)

And the same message above is failing to decrypt over and over.

Maybe the 15C Max has different functions/status compared to the 30C? 15C Max is model type T2128 vs T2118 for the 30C

silviudc commented 4 years ago

Just to mention the FW details on the eufyhome app: Wifi Version 1.1.2 and MCU Version 1.1.1

silviudc commented 4 years ago

Any chance to work together and get the error status issue resolved, I can provide assistance if needed. Without that working I cannot get any automations to work

michelcve commented 4 years ago

@mitchellrj I can confirm that I have the utf-8 codec errors as well with my Robovac.

Any chance you could look into this?

cjazinski commented 4 years ago

@silviudc You get anywhere on this? I'm having the exact same behavior as you.

silviudc commented 4 years ago

Yes I did a reset on the vacuum, re-added it to HA and it's been fine ever since. Too bad the integration doesn't have the 30 minute and edge modes options but it is better than nothing :)

cjazinski commented 4 years ago

Did you modify the tuya.py version number as I've seen floating around from 3,3 to 3,1? If I do that I see a different error (below). But still no functionality :( I've removed from the app and hard reset the device (holding down power until beep). What firmwares are you on? I'm running Wifi - 1.1.3and MCU 1.1.1


2020-04-24 12:45:24 INFO (MainThread) [homeassistant.components.vacuum] Setting up vacuum.eufy_vacuum

  File "/config/custom_components/eufy_vacuum/tuya.py", line 551, in _async_handle_message

  File "/config/custom_components/eufy_vacuum/vacuum.py", line 75, in async_update

  File "/config/custom_components/eufy_vacuum/tuya.py", line 506, in async_get

  File "/config/custom_components/eufy_vacuum/tuya.py", line 352, in async_send

  File "/config/custom_components/eufy_vacuum/tuya.py", line 571, in _async_send

  File "/config/custom_components/eufy_vacuum/tuya.py", line 482, in async_connect

  File "/config/custom_components/eufy_vacuum/tuya.py", line 551, in _async_handle_message

  File "/config/custom_components/eufy_vacuum/tuya.py", line 551, in _async_handle_message
pabsi commented 4 years ago

Yes I did a reset on the vacuum, re-added it to HA and it's been fine ever since. Too bad the integration doesn't have the 30 minute and edge modes options but it is better than nothing :)

Have a look at this PR: https://github.com/home-assistant/core/pull/25483

I included those 2 changes in HA and edge mode works. I personally do not use the 30 min one, although could probably be added based on the PR above.

Works on my RoboVac 30c

lordbeniel commented 4 years ago

I get the same problem

DEBUG:eufy_robovac.tuya:Received message from <DEVID> (<LOCAL_IP>:6668): Message(0x9, b'', 0, None) DEBUG:eufy_robovac.tuya:d69172a5c5501d8125e8b20849dfcb05f23d71c1a38449c85c6434bc9e0cf6f342199ddaec5cbdfb60523bd3831e0a3e60b151418b4d86b99f56f6b10c2ba261d281b29aceb879dea96f4a4bfa9c83e210700233ab4a679ef8e6a98463bbafb529130902f78122dcd007be6adc9ec981643786d645356c97cdac2fb7f153b3d3d669607aaeafe1749193e1c54753e666487a23e3d83d5208a60b562b9c879a0e529b58b0f45268801386e463bd14c365 ERROR:eufy_robovac.tuya:'utf-8' codec can't decode byte 0xa5 in position 3: invalid start byte ERROR:eufy_robovac.tuya:Failed to decrypt message from <DEVID> (<LOCAL_IP>:6668)

the demo works and commands can be issues but the status will not decrypt. please advise?

I've tried resetting and readding the device (a EUFY 15C MAX). and ive checked the keys atre correct multiple times

techcubs commented 3 years ago

anybody got this working ? I am having the same issues on my 30c

'utf-8' codec can't decode byte 0xd6 in position 9: invalid continuation byte Logger: custom_components.eufy_vacuum.tuya Source: custom_components/eufy_vacuum/tuya.py:403 Integration: eufy_vacuum First occurred: 25 December 2020, 11:52:08 (3899 occurrences)

Failed to decrypt message from (192.168.x.x:6668) Logger: custom_components.eufy_vacuum.tuya Source: custom_components/eufy_vacuum/tuya.py:562 Integration: eufy_vacuum First occurred: 25 December 2020, 11:52:08 (3899 occurrences)

Joeboyc2 commented 3 years ago

Hey, I still have this issue on one of my vacs, its odd becuase I have 2 of the same model, running the same firmware, only one of them gives me the errors, but its does control correctly regardless so I just ignore them now

On Sat, 26 Dec 2020, 09:35 techcubs, notifications@github.com wrote:

anybody got this working ? I am having the same issues on my 30c

'utf-8' codec can't decode byte 0xd6 in position 9: invalid continuation byte Logger: custom_components.eufy_vacuum.tuya Source: custom_components/eufy_vacuum/tuya.py:403 Integration: eufy_vacuum First occurred: 25 December 2020, 11:52:08 (3899 occurrences)

Failed to decrypt message from (192.168.x.x:6668) Logger: custom_components.eufy_vacuum.tuya Source: custom_components/eufy_vacuum/tuya.py:562 Integration: eufy_vacuum First occurred: 25 December 2020, 11:52:08 (3899 occurrences)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mitchellrj/eufy_robovac/issues/8#issuecomment-751338806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6SOLVVDX4XY7LWW3EMAD3SWWU7TANCNFSM4IURVOLA .

vomdth commented 3 years ago

Any updates or solution on this topic? Ir recently added my RoboVac 30C to HA. Everything works as expected except for the status show "error" :-(

jamesgibbard commented 2 years ago

I have the same issue. Any updates on how to resolve this? Thanks

t34wrj commented 2 years ago

I have the same issue. Any updates on how to resolve this? Thanks

I was having this issue - what I did to fix it was to cause an error with the vacuum by picking it up when it was vacuuming, then going into the Eufy app on my phone and clearing the error there. This had the effect of fixing the 'error' status in Home Assistant.

inijman commented 1 year ago

same issue here with G30. Forcing an error and fixing in the app did not resolve it.

Logs are flooding with: [custom_components.eufy_vacuum.tuya] Failed to decrypt message from bf2f2e7e175bdd05cxxxxx (10.0.0.xx:6668) [custom_components.eufy_vacuum.tuya] 'utf-8' codec can't decode byte 0xd0 in position 5: invalid continuation byte