apexad / homebridge-eufy-robovac

Homebridge plugin for Eufy RoboVac
MIT License
51 stars 18 forks source link

Robovac Error/Disconnected/Slowness/Warning in Homebridge 1.3.0: Slow to respond #34

Closed bennokress closed 2 years ago

bennokress commented 3 years ago

Just a heads up, as long as it still works as it does, I'm happy :) But maybe something can be done about it in the long run:

[2/22/2021, 10:16:53 AM] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info.
[2/22/2021, 10:16:53 AM] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'Status Low Battery' was slow to respond! See https://git.io/JtMGR for more info.
[2/22/2021, 10:16:53 AM] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://git.io/JtMGR for more info.
[2/22/2021, 10:16:53 AM] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'Charging State' was slow to respond! See https://git.io/JtMGR for more info.
[2/22/2021, 10:16:53 AM] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info.
apexad commented 3 years ago

Yes, I will be re-writing this plugin soon and will fix this warning.

raulfunkie commented 3 years ago

@apexad hey there Alex, let me know if you need any beta testers for the re-write. I might want to jump in on this train again and try to make my robovac work with HomeKit.

treforparr commented 3 years ago

Is there any way of removing local ID and Device ID maybe integrated through username and password like ring a token linked into the app, I was thinking about this a few days ago it's so difficult to get the local ID and device ID it must be an easy way of doing it, I know you're working extremely hard apexad I know there's an access to the Mac ID address now in app I don't know if that's any use at all

MonsterEnergy-wtf commented 3 years ago

@treforparr Short answer: no. The IDs are unique and have to match before you can establish a connection to the device.

ethempekin commented 3 years ago

Any progress on solving this issue? Thanks in advance.

MonsterEnergy-wtf commented 3 years ago

To be honest: I don't think so. The author is talking about the "rewrite" since last year and as this work is really voluntary I guess it will take a lot of time too. Also we all don't know what the reasons for the delay are and this is fine. As I mentioned: this is voluntary and every development needs to be taken in free time.

I'm currently working on my own to see what is causing the issue and how I could make the code more performant. But this will also take a bit of time as I'm running 3 Robovac 30C and homebridge natively under linux. So I will take some time for this but I don't want to give hope on this until I fixed the issues by myself.

ethempekin commented 3 years ago

Thanks for the efforts. Homebridge is a bit unreliable lately due to this but automations that I created works with the robovac so no big complaints here.

On Thu, 1 Apr 2021 at 20:16, MonsterEnergy-wtf @.***> wrote:

To be honest: I don't think so. The author is talking about the "rewrite" since last year and as this work is really voluntary I guess it will take a lot of time too. Also we all don't know what the reasons for the delay are and this is fine. As I mentioned: this is voluntary and every development needs to be taken in free time.

I'm currently working on my own to see what is causing the issue and how I could make the code more performant. But this will also take a bit of time as I'm running 3 Robovac 30C and homebridge natively under linux. So I will take some time for this but I don't want to give hope on this until I fixed the issues by myself.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apexad/homebridge-eufy-robovac/issues/34#issuecomment-812084645, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANXL5M3NZMUVNFV5QO726RDTGSZ7TANCNFSM4YAHQHFA .

apexad commented 3 years ago

So, I welcome anyone else to look into the issues with this plugin and do small fixes or a re-write.

Otherwise, It's still on my list of things to do a big re-write/re-factor of this plugin but indeed 2020 and 2021 have been interesting years and I have not found the time yet.

However, please note I still own this vacuum and still do plan to take a look at the issues with this plugin.

MonsterEnergy-wtf commented 3 years ago

So. What I found out after a bit of work:

When first contacting ONE RoboVac some methods are fired twice which makes it a bit confusing to clear up the issue. But the answer from the Robovacs comes too late and this is why Homebridge thinks, that the plugin is slowing down Homebridge. Once connections can be established to the device the message disappears.

Then I decided to move the class of eufy-robovac to this plugin as it is a piece of **** to have two packages which do one thing for Homebridge. This is working in my environment.

Then I removed all unnecessary stuff from the homebridge-eufy-robovac package to have a straight way to investigate issues. I removed the preparation "error handling for Robovac devices" i requested several months ago as it requires a push notification service which Homebridge doesn't support.

Then I removed the battery- and other services to make the codebase as small as possible.

Currently I'm rewriting the initializing method so events are not fired twice for once device. In my case I have three RoboVacs running and this causes Homebridge to request the devices 6 times over and over again. I guess this is why the plugin slows down Homebridge as the await takes a bit of time until the status is received.

Nice side effect: it seems that no Robovac loses connection and no API error related to timeout and stuff :)

apexad commented 3 years ago

Please push your code to GitHub if you can. It would fine in my opinion to strip this plugin down to only On/Off (Return Home) in an initial re-write.

I'm also considering combining the repos actually similar to how ring does it.

fairm010 commented 3 years ago

Happy to test any Beta / Rewrite that may come from your work here!

MonsterEnergy-wtf commented 3 years ago

First related to the initial post of this: Homebridge 1.3.0 has issues related to this error message. This should be fixed (or at least seen not so often) from version 1.3.3 and newer.

I'm using 1.3.4 running at my Mac locally for development reasons. I realized that Homebridge doesn't seem to be reliable as sometimes the Robovacs can be found without any issues and sometimes the plugin still slows down Homebridge.

Anyone have this issue too?

MonsterEnergy-wtf commented 3 years ago

I have a work around to skip the error messages from Homebridge related to slowing down stuff. I assume that Homebridge will be started when the Robovacs are not working. This speeds up the initialization of this plugin as I set values per default.

I will now test my stuff before pushing changes to this repository.

taaa22 commented 3 years ago

@MonsterEnergy-wtf Any updates on this? I'm having the same problem. image

MonsterEnergy-wtf commented 3 years ago

@taaa22 Yes and no at the same time.

The plugin itself is working but I still get the slow down message. To be honest: I don't believe that this is a problem on Homebridge side or TUYAPI (the API the plugin uses to establish connection to the Robovac). After some days of testing I got the feeling that the Robovacs are really slow to respond at all. This is why I did some nasty thing and set values automatically if the API is too slow to respond. This is most likely the case when the Robovacs are in sleep mode. When using the Robovacs the error message never came up.

At the end I still get the error messages from slowing down Homebridge, but I don't get the error message like you did. I hope I will find some time next week to work on this topic again. Currently my day is overloaded due some heavy work load at business side.

I will update you soon.

taaa22 commented 3 years ago

Thank you @MonsterEnergy-wtf for your reply. This error happens when you leave the eufy home app open. As soon as I closed the eufy app, it worked for me.

But I'm still getting the slow-down message.

Looking forward to your solution.

apexad commented 3 years ago

Same here. I have had a chance to fix some issues on some of my other plugins. This one is next up if MonsterEnergy does not beat me to it.

taaa22 commented 3 years ago

All the best @apexad. We really appreciate your work guys.

martijnpoppen commented 3 years ago

@apexad , Added a PR to the eufy-robovac repo. Found that you have to force the IP. This wil fix the Error: find() timed out. Is the device powered on and the ID or IP correct? Also giving a issueRefreshOnConnect will work with the statuses on startup of the Lib.

Next to that. I think that the memory issue comes from the on('data') event. the statuses are written to the variable. But when the vaccuum is moving it's overflowing and overwriting the complete list of the DPS values and only sending the location: Data from device: { dps: { '108': '[-307,2396,-8]' }, t: 1619003237 } instead of

  dps: {
    '102': 'Quiet',
    '104': 76,
    '105': 'MopHigh',
    '107': false,
    '108': '[-307,2396,-8]',
    '109': 10,
    '110': 0,
    '111': 43,
.....

Hope this helps. :)

PR: https://github.com/apexad/eufy-robovac/pull/18

MonsterEnergy-wtf commented 3 years ago

Folks, I give up fixing the "everything is going to be slow because of this plugin blahbla".

Let me explain why.

1) I had three of the robovacs and one started to have issues with the wheel (strange sound). So I ordered a spare part from China. After disassembling and reassembling the device it threw an error which says that the fall sensors are dirty. Long story short: I have a 200€ piece of dead tech at my work bench. So I guess that Eufy used cheap pieces which break once you touch the device. This leads direct to part 2

2) From my work on this plugin I wasn't able to remove the warning in Homebridge completely. It really slows down HomeKit the more devices you own. I also realized that the devices are really slow to answer. I believe that the TUYA Api is doing some weird stuff on the devices. Long story short: the devices are too slow and the error still comes up.

From my perspective I stopped working on this plugin and removed the homebridge entierly from Homekit.

Sorry to say this but I will not spent more time in this plugin as the devices especially the hardware is too slow. So it makes no sense to invest more time than I did.

apexad commented 3 years ago

The key to getting rid of the 'plugin slows down homebridge' is to make it so status checks fall back to a previous check and queue an update to set the cached status. Actions may be tough to do this with, but hopefully those are fairly quick.

My single vacuum is not used as much as I would like but I still have it. Still plan to put in some work on this plugin and the underlying library (possibly seek to combine them). Like most homebridge developers though I've been a bit of a hiatus lately though and have other plugins I am working on as well.

ethempekin commented 3 years ago

There were some days with better connection but lately it slows my homekit too much so i disabled it. Thanks again for updates.

gerbenvandijk commented 3 years ago

Same here, also disabled it but keeping a keen eye on future updates. Was awesome for a while (I used it to let the vacuum do its thing while I'm out and stop and dock when I got back), but it made all other homebridge devices unresponsive as well so hence. If I can contribute in any way with testing I would be happy to, I can't contribute to development due to other current obligations. Thanks so much for the effort so far 👍

apexad commented 3 years ago

Sorry all, I may just pull this plugin from npm until I get a chance to attempt some major refactoring. What I will probably end up doing is try to go as simple as possible. Back to just a single on/off switch for the vacuum to start or return home. Adding error checking, battery, etc... was probably not the right way to go.

elliottlack commented 3 years ago

I'll happily beta test the new plugin when available

ctrlcmdshft commented 3 years ago

I would enjoy this even as a simple on/off. Any alerts or settings I would just use app. I mean I already have the settings I need set and just use app to start the vacuum.

So I'm all for a simple bot to get this going again

leesonthenet commented 2 years ago

Sorry all, I may just pull this plugin from npm until I get a chance to attempt some major refactoring. What I will probably end up doing is try to go as simple as possible. Back to just a single on/off switch for the vacuum to start or return home. Adding error checking, battery, etc... was probably not the right way to go.

Keeping it simple I would agree would be the way to go. I've had to disable this plugin for now - not sure if Eufy made some changes on their end, but it rarely connects/works anymore.

ctrlcmdshft commented 2 years ago

Sorry all, I may just pull this plugin from npm until I get a chance to attempt some major refactoring. What I will probably end up doing is try to go as simple as possible. Back to just a single on/off switch for the vacuum to start or return home. Adding error checking, battery, etc... was probably not the right way to go.

Keeping it simple I would agree would be the way to go. I've had to disable this plugin for now - not sure if Eufy made some changes on their end, but it rarely connects/works anymore.

Simple is better less headaches and easier to maintain, all i need personally is single on/off

elliottlack commented 2 years ago

Agreed, all I was hoping to do was turn on and return home.

QandnotU commented 2 years ago

@apexad I'd be happy to throw some money your way if we could get a re-write with a simple start and send home. I'm sure anyone else looking for this would too. If you have the bandwidth, let me know.

fairm010 commented 2 years ago

@apexad I'd be happy to throw some money your way if we could get a re-write with a simple start and send home. I'm sure anyone else looking for this would too. If you have the bandwidth, let me know.

If you'd just like start and send home I can write you a guide (when my MacBook is fixed lol) on how I have this working via a slightly convoluted method including using Alexa.

MonsterEnergy-wtf commented 2 years ago

Folks, as I already wrote in one of my older posts I really believe that the implementation itself is not causing the issue.

From my perspective I can say that three Robovacs 30C are really slow to respond. The fuctionality is working but the response from the robovacs are comming too late. This causes the implementation to wait until a response comes back. And this causes Homebridge to say that this plugin slows down Homebridge. And this is correct.

So long story short: the plugin itself is not causing the problems rather than the "slowness" of the robovacs. At least from the 30C models i own.

I guess that this problem also prevents the robovacs from beeing Honekit certified.

I strongly believe that a full rewrite will not resolve hardware related issues.

QandnotU commented 2 years ago

Fair enough, I missed this, thanks! Would be nice, at the very least, if Eufy added Shortcuts support.

ThatisN0tM3 commented 2 years ago

Hello,

i am not sure if this is the right posting, but i try it.

I have loaded hoobs on my Raspberry, set fix IP Adress, Login Datas........ I try to add my Eufy Robovac G10 for using in Apple HomeKit.

one time the G10 is added like Fan, it is ok because HomeKit do not have a direct support for the vac-cleaner. But i can not activate it, only the message in HomeKit that the device is not active. Ok i login in hoobs look for Problem and in the Logs MANY RED NOTES like: not enouth power, answer to long, ......

ok ok factory Reset of the hoobs, i thought i have a mistake in the configuration and make it new.

BUT NOW: i have entered all the Information again:

but no - NOTHING is Found.

Can somebody help me pls? i do not now any more where i have make the mistake.

hov3rcraft commented 2 years ago

I attempted a full rewrite of the plugin and was able to solve the "slow to respond" issue. Controlling the RoboVac using the Home app and starting the cleaning using an automation work reliably now! However, my "return to home" automation still gives me trouble. Anyone interested in testing?

If you are interested in the details: The main issue seems to be that the callbacks in the plugin take too long, then Homebridge will throw this warning. The second issue is that the plugin makes a lot of get requests to the RoboVac in parallel (1-2 for each property that is displayed in the Home app). I fixed that by just responding to each of the callbacks with a default value and updating the properties later when the response was received. Furthermore, I am now caching the responses to any get requests, so that now requests are sent in parallel.

ctrlcmdshft commented 2 years ago

@hov3rcraft I can try how do i load yours into home kit

R3ngadechaZzz commented 2 years ago

Hi,

I’m interested in testing

On Thu, 20 Jan 2022 at 16:43, hov3rcraft @.***> wrote:

I attempted a full rewrite of the plugin and was able to solve the "slow to respond" issue. Controlling the RoboVac using the Home app and starting the cleaning using an automation work reliably now! However, my "return to home" automation still gives me trouble. Anyone interested in testing?

If you are interested in the details: The main issue seems to be that the callbacks in the plugin take too long, then Homebridge will throw this warning. The second issue is that the plugin makes a lot of get requests to the RoboVac in parallel (1-2 for each property that is displayed in the Home app). I fixed that by just responding to each of the callbacks with a default value and updating the properties later when the response was received. Furthermore, I am now caching the responses to any get requests, so that now requests are sent in parallel.

— Reply to this email directly, view it on GitHub https://github.com/apexad/homebridge-eufy-robovac/issues/34#issuecomment-1017700460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXA5X7POFTI5D2NX6CYS7CLUXA3RPANCNFSM4YAHQHFA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

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

-- Charles Nelhams

raulfunkie commented 2 years ago

Interested as well.

ThatisN0tM3 commented 2 years ago

I attempted a full rewrite of the plugin and was able to solve the "slow to respond" issue. Controlling the RoboVac using the Home app and starting the cleaning using an automation work reliably now! However, my "return to home" automation still gives me trouble. Anyone interested in testing?

If you are interested in the details: The main issue seems to be that the callbacks in the plugin take too long, then Homebridge will throw this warning. The second issue is that the plugin makes a lot of get requests to the RoboVac in parallel (1-2 for each property that is displayed in the Home app). I fixed that by just responding to each of the callbacks with a default value and updating the properties later when the response was received. Furthermore, I am now caching the responses to any get requests, so that now requests are sent in parallel.

Sure i want to test it, when you tell me how i can implementate it in my HomeBridge / Hoobs System

steverae68 commented 2 years ago

Just installed this plugin and although I have my Id and key, I too, get this error [26/02/2022, 08:04:56] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

Any news on when this update will be released

apexad commented 2 years ago

I recently updated it to get rid of battery and error sensors and stuff. Will fix it soon to do a cache for the on/off so this error does not get logged. Possibly this weekend. However, please understand this won't make anything actually faster, it will just make homebridge not realize it is not fast.

steverae68 commented 2 years ago

Thanks for the update. On my system, this robovac never goes online, it simple toggles between. Updating and no response status in HomeKit with the above error repeating in Red.
I have the x8 robovac on latest firmware 1.3.1.1 ?

Happy to beta test anything you need me too.

@apexad did you see my post re: getting deviceid and key using this...

https://gitlab.com/Rjevski/eufy-device-id-and-local-key-grabber/-/merge_requests/2

This worked a treat on my pi and could easily be incorporated directly into your plugin (possibly) with permission ?

steverae68 commented 2 years ago

Here are the logs from my current config that never actually starts

[28/02/2022, 18:03:09] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info. [28/02/2022, 18:03:15] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info. [28/02/2022, 18:04:30] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info. [28/02/2022, 18:04:36] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

Let me know how i can fix this

apexad commented 2 years ago

Definitely going to integrate the automatic device id and local key grabber. I have to rewrite it in node though, so it will take some time.

I actually don't currently have my own vacuum. It's somewhere in a box unfortunately.

Will take a look at your logs and see if I can find anything that might have created the issue. May want to see if the previous version works?

steverae68 commented 2 years ago

Alex - even the older versions back to 2.10 gave the same errors S shown here. I never get my vacuum to appear in HomeKit, it just goes from updating to no response than back

apexad commented 2 years ago

Interesting. That model may be returning different stuff. You may want turn on debug mode and open a new issue with those debug logs.

steverae68 commented 2 years ago

I'll do this tonight and send in the logs 👍

steverae68 commented 2 years ago

[01/03/2022, 20:30:08] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info. [01/03/2022, 20:30:14] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info. Connecting... Robovac Error {} Disconnected! Connecting... Robovac Error {} Disconnected! Connecting... Robovac Error {} Disconnected! [01/03/2022, 20:30:45] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info. [01/03/2022, 20:30:51] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

This device is the new Eufy RoboVac X8 with the latest 1.3.1.1 firmware.

Hope this helps with your diagnostics

As stated, this device never goes to online more in HomeKit, jut bounces from Updating to No Response then repeating.

What is weird though is that my TuyaLan plugin detects the device ID but obviously does not connect to It. so the device ID is correct

fairm010 commented 2 years ago

Just to add, I get pretty much the same log but on an old Robovac 30C.

ctrlcmdshft commented 2 years ago

Having same issues with different vacuum mine is the Eufy RoboVac G30 Edge

Device never goes online in HomeKit, just bounces from Updating to No Response then repeating.

2/28/2022, 10:39:44 PM] [Vacuum Cleaner] Initializing Eufy RoboVac accessory...
Connecting...
[2/28/2022, 10:39:44 PM] [Vacuum Cleaner] Vacuum Cleaner finished initializing!             
Robovac Error {}
Disconnected!
Connecting...
Robovac Error {}
Disconnected!
[2/28/2022, 10:39:53 PM] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://git.io/JtMGR for more info.
[2/28/2022, 10:39:59 PM] [homebridge-eufy-robovac] This plugin slows down Homebridge. The read handler for the characteristic 'On' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.
Connecting...
Robovac Error {}
Disconnected!