fuatakgun / eufy_security

Home Assistant integration to manage Eufy Security devices as cameras, home base stations, doorbells, motion and contact sensors.
877 stars 73 forks source link

expired token - failure to receive notifications from add-on #101

Closed zadigre closed 2 years ago

zadigre commented 2 years ago

I'm not sure if this is a feature request, a bug report or asking for help.

I have two Indoor Pan&Tilt Cameras and two Eufycam 2 Pro (with home base). when I arm/disarm the home base, I receive a notification in the Eufy Security app and also the arm/disarm status is changed instantly in HA.

but for the Indoor cameras, it doesn't seem to have a way to receive a notification for arm/disarm changes. Thus HA or Eufy Security integration doesn't receive the change. If I reload the integration or open the Eufy Security app on my iPhone (running on a different username), I'll get the state change in HA.

my cloud scan is set to 600 seconds. I'm expecting for the arm/disarm state to a least update every 600 seconds. But even if I wait 600 seconds, it won't update.

is there a way to receive these stat changes in HA without reloading the integration or opening the app?

zadigre commented 2 years ago

apparently, I'll get the update within a few minutes after restart the integration. but this will eventually stop.

So I guess this is a bug report unless you have anything to suggest.

fuatakgun commented 2 years ago

hey @zadigre , as you had pointed out, this integration totally relies on notifications to catch up reality.

Can you check device setting if there is any configuration about firing notifications for switching modes?

if not, you can share your camera and I can take a look at it. following README file.

zadigre commented 2 years ago

there's no notification setting for switching modes on both of my indoor pan&tilt camera. but I do see this setting for the homebase linked to the Eufycam 2 Pro. but sadly, I cannot connect the indoor cameras to the home base. I shared one of my camera with your US account email address (I'm in Canada... so I guess this is the one I should use. I have 2 of the same models... I only shared one.

fuatakgun commented 2 years ago

yes, please share name of the camera :) there are many of them now, it is getting difficult for me to track them

zadigre commented 2 years ago

it's called "2e"

fuatakgun commented 2 years ago

you might receive some motion notifications, thanks to your cat :) I am receiving all updates immediately for your 2e camera. I switched guard mode using HA and refreshed the mobile app and got the new state. I switched guard mode using mobile app and got the new state in integration immediately.

this might be resolved with new integration which is working in my local. Let's test this after I publish new revision in couple of days/hours

please remove the shared camera

zadigre commented 2 years ago

It was working yesterday. It didn’t work today until I restarted the integration. So it stops working by itself after a few hours for both of my indoor cameras… but works fine all the time with my eufycam 2 Pro. Hopefully your new integration will help with stability.

fuatakgun commented 2 years ago

can you check if there is any error happening in add-on like timeout or connection issues? if yes, we might need to create a separate issue over here: https://github.com/bropat/eufy-security-ws

zadigre commented 2 years ago

I see this errors... but still working now. but I guess it might stop because of this after a few minutes or hours. this appeared in the log when HA disabled both homebase and one of my indoor camera when I arrive at home.

Error FID Token renewal failed with error: Bad Request error stack: • service.ts:131 renewFidToken node_modules/eufy-security-client/src/push/service.ts:131:23 • service.ts:155 renewPushCredentials node_modules/eufy-security-client/src/push/service.ts:155:45 • service.ts:491 _open node_modules/eufy-security-client/src/push/service.ts:491:32 • service.ts:510 node_modules/eufy-security-client/src/push/service.ts:510:17 2021-11-06 14:55:08.878 ERROR Push credentials renew Error: Error FID Token renewal failed with error: Error: FID Token renewal failed with error: Bad Request error stack: • service.ts:135 renewFidToken node_modules/eufy-security-client/src/push/service.ts:135:19 • service.ts:155 renewPushCredentials node_modules/eufy-security-client/src/push/service.ts:155:45 • service.ts:491 _open node_modules/eufy-security-client/src/push/service.ts:491:32 • service.ts:510 node_modules/eufy-security-client/src/push/service.ts:510:17 2021-11-06 14:55:08.886 ERROR Push notifications are disabled, because the registration failed!

fuatakgun commented 2 years ago

This is the culprit please create an issue on mentioned repository. When your token expires it will stop working

fuatakgun commented 2 years ago

This is the culprit please create an issue on mentioned repository. When your token expires it will stop working

zadigre commented 2 years ago

done here https://github.com/bropat/eufy-security-ws/issues/42

fuatakgun commented 2 years ago

updated both add-on and integration, please give it a try, YOU MUST UPDATE BOTH OF THEM.

https://github.com/fuatakgun/eufy_security/issues/59#issuecomment-968352909

zadigre commented 2 years ago

I installed both. HA Reboot. so far all looks fine. I was seeing some warnings in the Add ON log before... the warnings are no longer there. I'll report back after a few days.

fuatakgun commented 2 years ago

good news, please keep us updated

zadigre commented 2 years ago

was still working fine minutes ago. I saw an update on the Eufy Security integration in HACS. I just installed it. will report back again later.

fuatakgun commented 2 years ago

Any updates?

zadigre commented 2 years ago

still working today. new version may have helped... or rebooting my cameras fixed it. I've got a firmware upgrade on my cameras that was installed a few days ago which may help also.

fuatakgun commented 2 years ago

Happy to hear that, resolving now, comment if this happens again