Skip to content

Instantly share code, notes, and snippets.

@tubalainen
Last active June 11, 2021 05:53
Show Gist options
  • Save tubalainen/ee57f97dffab3f43d6021eaaae5d4526 to your computer and use it in GitHub Desktop.
Save tubalainen/ee57f97dffab3f43d6021eaaae5d4526 to your computer and use it in GitHub Desktop.
Instructions/readme.MD
**Frigate - Home Assistant - Blue Iris NVR automation example**
The basics:
Blue Iris is a normal "dumb" NVR software that records several camera RTSP streams and present it to an API and a number of user interfaces. There isnt any great local AI features built in, it normally triggers motion based on "motion detection" (that would be considered somewhat advanced). There´s a lot of false positives causing the NVR event recording to be somehwat useless. Yes, I know, there are several ways to tweak and fix this to lessen the false positives.
There are quite a community around the Blue Iris software and there are other stabs at making local AI such as the "aitool" with Deepstack.
I got inspired by the video from "The Hookup" on youtube explaining the setup with the "aitool" and Deepstack. I tried it and it works - ish.
Link to the hookups video with all Blue Iris configuration: https://www.youtube.com/watch?v=fwoonl5JKgo
I base all my Blue Iris configuration on the example from the video above - but i´d just simply turned off picture save to folder feature (that the aitool uses to pick up the jpeg and send it deepstack). Instead I use frigate and a Home Assistant automation.
Installation:
* Make sure that your Blue Iris NVR has been configured so that the API calls and user/password has been set.
* Test the HTTP request manually in a browser to see that it works and triggers recording of the HD camera instance in Blue Iris
* Then, just make a copy of the package yaml file above and adjust the entities accordingly into the folder '/config/packages' in your home assistant installation
* Reload Home Assistant and test trigger the automation
## This is a package file to be used with Home Assistant. You need to adjust all entities below to suit your installation as well as username/password/ip address to your Blue Iris installation
shell_command:
alert_bi: "curl {{ url }}"
## Example automation that once frigate triggered motion of a person the recording for all cameras on my front yard (three of them) will start
automation:
- id: person_detected_send_req_to_bi
alias: "Frigate Trigger to record BI"
initial_state: 'on'
trigger:
- entity_id: binary_sensor.cam9_uppfart_frigate_person
platform: state
to: 'on'
trigger:
- entity_id: binary_sensor.cam1_framsidan_frigate_person
platform: state
to: 'on'
trigger:
- entity_id: binary_sensor.cam3_framsidan_frigate_person
platform: state
to: 'on'
condition: []
action:
- service: shell_command.alert_bi
data:
url: 'http://192.168.1.10:81/admin?trigger&camera=cam9_hd&user=aiuser&pw=secret' # Sends a HTTP requrest to Blue Iris API to start recording in HD in Blue Iris for Camera 9
- service: shell_command.alert_bi
data:
url: 'http://192.168.1.11:81/admin?trigger&camera=cam3_hd&user=aiuser&pw=secret' # Sends a HTTP requrest to Blue Iris API to start recording in HD in Blue Iris for Camera 3
- service: shell_command.alert_bi
data:
url: 'http://192.168.1.12:81/admin?trigger&camera=cam1_sd&user=aiuser&pw=secret' # Sends a HTTP requrest to Blue Iris API to start recording in HD in Blue Iris for Camera 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment