samemory / homebridge-eufy-security

Work in progress
Apache License 2.0
97 stars 14 forks source link

[Bug]: All added Eufy devices disappear in Home app if Homebridge is down for some time #264

Closed njuart closed 2 years ago

njuart commented 3 years ago

What happened?

Hi, so issue is following. I had a power outage for a half of a day, so my Raspberry was down, when it went up again I've noticed that all my added Eufy devices were gone from Home app. After some time and a couple of restarts they were added again by themselves, but as new devices, meaning I've lost all my automations and had to rename them again. I've decided to check, maybe it's a sort of a one-time issue, so I've powered off my Raspberry again, this time intentionally, waited for a couple of hours, and voila it happened again, same stuff, besides that it is related only to Eufy plugin, all my other 12 plugins didn't show this behaviour. Anyway it can be fixed? It's a bit annoying to create automations everytime it happens. Thx in advance!

Device Type

Station (Supported)

Plugin Version

v1.0.x (Supported)

HomeBridge Version

v1.3.x (Supported)

NodeJS Version

v14 (Supported)

Operating System

Docker

Relevant log output

Could not retrieve logs unfortunately.
github-actions[bot] commented 3 years ago

Did you check this Common Issues pages ?

sunnyysetia commented 2 years ago

I've got the exact same issue as this. Very frustrating as I have a lot of automation linked with the eufy devices hence them resetting makes me have to rename, regroup and re program every device. Desperately looking for a fix to this. The only bad link in my smart home.

lenoxys commented 2 years ago

Hey,

Eufy did change something in their side. when you set guest rights instead of admin, you loose access to device linked to a base. You need to change the rights of the eufy account to admin.

Regards, Aurelien

njuart commented 2 years ago

But my guest account, for example, was set to admin rights since the beginning. Still I have this issue.

sunnyysetia commented 2 years ago

Same mine has also been set to admin rights from the start

njuart commented 2 years ago

Happened to me again just right now. So frustrating. I've updated to Homebridge 1.38, it restarted, after restart I saw this

image

And then this

image

I've opened Home app and all my Eufy devices disappeared, so all automations related to them also.

After additional restart just a few minutes after, devices re-appeared, but as newly installed, with default names.

image

njuart commented 2 years ago

Basically every server restart or even HB restart, it happens. Unfortunately it makes plugin almost unusable for me, as I might do a couple of restarts during a day, I thought it somehow related to child bridge, but it's not, it happens without child bridge as well. @lenoxys Any ideas? Thx in advance

sunnyysetia commented 2 years ago

Personally for me this issue only happens if the eufy HomeBase is down during the starting up of homebridge. Otherwise starting/ restarting of homebridge works fine. Nonetheless this is still a hassle and a solution would be very nice. I wonder if everyone with this plugin has this issue 🤔

njuart commented 2 years ago

Now after issue happened again, plugin doesn't find any device at all.

gielk commented 2 years ago

Now after issue happened again, plugin doesn't find any device at all.

I'm currently having the exact same problem. I'm waiting for them to come back but every time the message that no devices were found.

[24/11/2021, 17:19:56] [Homebridge UI] [homebridge-eufy-security] [1.0.4] DEBUG: Response:

[24/11/2021, 17:19:56] [Homebridge UI] [homebridge-eufy-security] [1.0.4] ERROR: Status return code not 200 { status: 204, statusText: 'No Content' }

njuart commented 2 years ago

Now after issue happened again, plugin doesn't find any device at all.

I'm currently having the exact same problem. I'm waiting for them to come back but every time the message that no devices were found.

[24/11/2021, 17:19:56] [Homebridge UI] [homebridge-eufy-security] [1.0.4] DEBUG: Response:

[24/11/2021, 17:19:56] [Homebridge UI] [homebridge-eufy-security] [1.0.4] ERROR: Status return code not 200 { status: 204, statusText: 'No Content' }

Yup, I see exactly the same in debug logs. Deleting plugin config doesn't help, uninstalling plugin completely doesn't help either.

schliemann commented 2 years ago

This is the issue in the client library.

https://github.com/bropat/eufy-security-client/issues/67

schliemann commented 2 years ago

If you need a quickfix you would have to update the client library manually.

gielk commented 2 years ago

If you need a quickfix you would have to update the client library manually.

Can u explain how to do this or where can I find a how to?

schliemann commented 2 years ago

Update the packages.config file to use version 1.4.0 of eufy-security-client.

schliemann commented 2 years ago

Then run npm install

ppernet commented 2 years ago

Same here. During last days, Eufy device reappeared after few server restart but now, nothing to do, no eufy devices in homekit app. Hope it will be fixed soon because most of us have lot of automation including Eufy devices...

fenninculus commented 2 years ago

Same problem here too 😞

sunnyysetia commented 2 years ago

Incredibly frustrating, on restart of hoobs all devices have vanished and cannot be found despite the homebase being on the whole time. (In the past the devices would only reset if HomeBase was off during boot which was still shitty but not as bad as it is now). Hoping the devs can fix this soon.

loganfuller commented 2 years ago

I'm also having this issue. Can we not have a config setting to never remove cached devices?

sunnyysetia commented 2 years ago

I hope the plugin devs are seeing this, I think this needs to be top priority to really make this plugin full proof

fenninculus commented 2 years ago

For me this issue was resolved in the latest patch.

schliemann commented 2 years ago

I'm also having this issue. Can we not have a config setting to never remove cached devices?

Wouldn't help. If the client library doesn't find the device then commands can't be sent anyway.

loganfuller commented 2 years ago

I'm also having this issue. Can we not have a config setting to never remove cached devices?

Wouldn't help. If the client library doesn't find the device then commands can't be sent anyway.

I don't follow. The issue is in removing cached devices because of an ephemeral connection issue. While the library wouldn't be able to find the device, it would in the future once the temporary issue clears up.

schliemann commented 2 years ago

I'm also having this issue. Can we not have a config setting to never remove cached devices?

Wouldn't help. If the client library doesn't find the device then commands can't be sent anyway.

I don't follow. The issue is in removing cached devices because of an ephemeral connection issue. While the library wouldn't be able to find the device, it would in the future once the temporary issue clears up.

Ah. Now I understand. It might be possible.

schliemann commented 2 years ago

I have asked in the homebridge discord if we can determine when a cached device was added. Then a config element could be added specifying how many days we would like to keep inactive devices.

schliemann commented 2 years ago

699CD397-85AF-40D3-A371-44FB20C681FC

lenoxys commented 2 years ago

I used to implement a clean task when device is no more linked to the station.

https://github.com/samemory/homebridge-eufy-security/blob/master/src/platform.ts#L304-L313

this could explain that, while trying to connect it can't so hb don't retreive then clean all of them.

schliemann commented 2 years ago

@lenoxys Yeah. Maybe the easiest fix would be a boolean in the config that determines if the user wants accessories cleaned on startup.

NorthernMan54 commented 2 years ago

@schliemann @lenoxys In my Tasmota plugin I have a setting that remove's / cleans up not responding devices after a set period of time. I defaulted it to 24 hours just to avoid these type of issues. I just set a nodejs for timeout for each accessory on startup, and if status hasn't been received / updated before the timeout is invoked, remove it. It also resets the timeout with each status update.

As my setup got whacked by this, do you need help in configuring this ?

schliemann commented 2 years ago

I think it is a relatively small fix. But I have used all my spare time on the local stream snapshot.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 5 days with no activity.

loganfuller commented 2 years ago

Can we re-open this? With this issue, I have to completely rebuild my eufy automations at least once a week due to intermittent connection issues..

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

loganfuller commented 2 years ago

Still an issue.

lenoxys commented 2 years ago

You will be able to disable this behavior within the settings.