colinbendell / homebridge-blink-for-home

Blink For Home Camera Homebridge plugin
MIT License
88 stars 27 forks source link

Can't activate/deactivate multiple camera in a scene #14

Closed bolducd closed 3 years ago

bolducd commented 3 years ago

I created a scene that run when I leave the house to enable 2 cameras ( I have 4 cameras, one outdoor always enable, 2 indoor battery camera and a mini (enable is not working on the mini but I understand mini is not supported yet). I want to enable all camera when I leave the house and disable all indoor cameras when I come back.

So I created an HomeKit scene to enable 2 cameras when I leave and another one to disable 2 cameras when I come back home (will include mini in this when mini get supported).

But only 1 camera get enable or disable when the scene run. I need to run the scene a second time for both camera to get enable or disable. I know the process to enable a camera involve activating motion on blink server for that camera and on the blink side this involve connecting to the sync module to activate the camera each time.

If I use the blink app when armed to activate motion on a camera I need to wait a few seconds before activating second camera or I get an error saying sync module already occupied and it fails. Could it be the same thing happening with your code?

Thank you for integrating blink in home bridge!

colinbendell commented 3 years ago

Just to make sure I understand the flow:

Your hypothesis about he sync module being busy makes sense, and I'll check into it. I'm very likely not checking on the sm status before going forward.

I'm curious about the mini's though - why you can't enable/disable them. (I don't have one so I can't test directly). I just went through the code and it looks like I misunderstood how the mini's should work. I'll make it so they can be enabled/disabled like the other cameras.

Also, It would be helpful if you could enable the diagnostic switch and PM the output from the logs.

bolducd commented 3 years ago

That's exactly the flow.

For the mini the enable/disable button is not there. Privacy is and works.

Will send logs as soon as I can.

Thank's

colinbendell commented 3 years ago

Can you try the latest version? I'm flying a bit blind, but based on my read of the blink app it should work now?

bolducd commented 3 years ago

Now with latest version (v3.5.17) and debugging ON. Problem still present. Can see in the log that Sync module is busy.

[11/11/2020, 5:47:08 AM] [Blink] { connection: 'keep-alive', 'content-length': '52', 'content-type': 'application/json', date: 'Wed, 11 Nov 2020 10:47:08 GMT', server: 'nginx + Phusion Passenger', status: '409 Conflict', via: '1.1 xxx.cloudfront.net (CloudFront)', 'x-amz-cf-id': 'xxx', 'x-amz-cf-pop': 'xxx', 'x-blink-served-by': 'xxx', 'x-cache': 'Error from cloudfront', 'x-content-type-options': 'nosniff', 'x-powered-by': 'Phusion Passenger' } [11/11/2020, 5:47:08 AM] [Blink] {"message":"System is busy, please wait","code":307} [11/11/2020, 5:47:08 AM] [Blink] { method: 'GET', headers: { 'User-Agent': 'Blink/8854 CFNetwork/1202 Darwin/20.1.0', 'app-build': 'IOS_8854', Locale: 'en_US', 'accept-language': 'en_US', Accept: '/', TOKEN_AUTH: xxx

bolducd commented 3 years ago

Updated to 3.6.2 and it's working! (except for blink mini but blink mini enable/disable is not working manually either with the plugin). There's already a bug #30 open for blink mini.

Thank you. I'm closing this one.