My assumption would be too many API calls too quickly, so Blink is probably throttling you (you probably have an error in your logs saying “Problem connecting to servers” or something). It would probably be better to individually call the service for each camera with a ~5s delay in between each call (I would expirment with that value though, 5s is just a guess).
Also, maybe you’re aware of this but I’ll mention it anyways, enabling motion detection for an individual camera does NOT enable motion detection for the system. You have to arm the sync module via the alarm control panel to do that. If the sync module is disarmed, your cameras having motion detection enabled won’t actually do anything.
You can make multiple service calls in the same automation, so you would only need one automation to do this. As an example, I do that here where I am taking a picture with my blink camera over a certain interval and then save that image to a folder
@fronzbot - would you be able to repost your blink script - the link seems to have expired? I’m trying to do something similar but my cameras aren’t updating. I’ve added in 30s delays between cameras because I’ve found if my internet is slow, sometimes it can take longer.
Also I noticed you had a few blink scripts on other threads here that are also expired. It’d be awesome if you’re able to share what you’ve setup with blink because I’ve been trying to optimise the setup (including the UI for it on lovelace) and would be great to view other setups.
Hey guys, I’ve been trying to have a xiaomi speaker play a sound if my camera detect motion but I’m struggling to have blink’s motion binary sensors activate on motion.
Here’s what I have:
# Notify on camera motion
- alias: Camera motion
trigger:
- entity_id: binary_sensor.blink_front_door_motion_detected
platform: state
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: binary_sensor.blink_front_door_camera_armed
state: 'on'
action:
- data:
gw_mac: <hidden>
ringtone_id: 13
ringtone_vol: 30
service: xiaomi_aqara.play_ringtone
I have the blink system armed and the Front Door Camera set to detect motion. I wave my hand in front of it which triggers Blink to capture video and the Blink app lets me know that motion was detected. But the automation does not trigger any sound or notification by HA. When I look at the binary_sensor.blink_front_door_motion_detected state, it says that it hasn’t detected motion for 6 days. Not sure why. Any ideas would be appreciated!
The blink integration operates on a polling scheme, so it’s only looks for motion every so often based on your scan_interval, which i think is 5 minutes by default, so your automation probably wouldn’t work very well anyways.
As to why it hasn’t reported motion detection in awhile…that sounds like an issue. So some questions for you:
Do you have multiple sync modules, or just one?
What version of HA are you on?
Do you manually delete videos after they are recorded (via the blink app)?
What is your region_id? (go to dev tools --> states --> alarm_control_panel.blink_blahblahblah and look for the “region_id” attribute.
@fronzbot - thanks for the response. Answers to your qns below.
I have only 1 sync module
Version 0.91.1
Yes I do. But to test this, I left the videos there for a while and still didn’t see it come up.
Region is = prsg
Re your point about polling period - can the blink app be forced to notify on motion? Feels a bit surprising that there isn’t a more immediate way to update home assistant if it detects something.
Ok, thanks for the info. I’m wondering if the new video endpoint I’m using for motion detection just isn’t implemented yet across all regions. I only know for sure that it works for ‘prod’ (US) and ‘prde’ (Europe). That might be the root cause of the issue.
For polling period- no, there is no way (currently) to get an immediate update from Blink. This would require the underlying library to have a closer integration with Blink (ie. I would actually have to work with Blink to implement it). The library is just a third-party API I wrote based on standard http requests to try and closely mimic the behavior of the Blink app.
If you’re willing to try some more debugging, here is a suggestion (more work on your end, and it’s not a problem if you are uncomfortable doing it):
Disable all integrations other than blink in your configuration.yaml file
Re-start home-assistant and then try to trigger your camera for motion.
~6 minutes later (assuming the binary_sensor for motion detection did not change to True) copy and paste the contents of your homeassistant.log file here (or upload it somewhere and add a link to download it, email me (link in profile), doesn’t really matter).
Doing that should allow me to see every api call that is made to try and narrow down what is failing and hopefully allow me to figure out a fix. I also opened up an issue regarding this on the main library page here
Ok sure. I’ll take a crack at it on the weekend and post what I find.
Re: polling period - understood. My use case was going to be to connect the blink cameras to my xiaomi gateway. So at night if it senses motion, rather than just notifying my phone (which may not wake me up), it’ll activate my speaker’s alarm and wake me up as well as hopefully scare them off. Understand if the current integration doesn’t allow it to be used in that way though. Will have to figure something else out.
To get a pushed notification you can add ifttt and create an applet that will notify homeassistant everytime your camera will detect a motion. It’s not perfect but will do the job.