I use these cameras in a group that is visible in the front end. Pictures update every 5-10 seconds which works great for me. I also do send screen shots to push bullet using a pythons script, I use the line crossing sensor as a trigger.
capture_driveway1_camera:
alias: Capture Still Image from Driveway 1 Camera
sequence:
- service: switch.turn_on
entity_id: switch.save_driveway1
- service: switch.turn_off
entity_id: switch.save_driveway1
capture_driveway2_camera:
alias: Capture Still Image from Driveway 2 Camera
sequence:
- service: switch.turn_on
entity_id: switch.save_driveway2
- service: switch.turn_off
entity_id: switch.save_driveway2
capture_backgate_camera:
alias: Capture Still Image from Backgate Camera
sequence:
- service: switch.turn_on
entity_id: switch.save_backgate
- service: switch.turn_off
entity_id: switch.save_backgate
capture_sideyard_camera:
alias: Capture Still Image from Sideyard Camera
sequence:
- service: switch.turn_on
entity_id: switch.save_sideyard
- service: switch.turn_off
entity_id: switch.save_sideyard
Here is my automations, I have some conditions to reduce the alerts, these may need to be adjusted dependeding on your camera setup.
##########################################
## Camera Picture Alerts ##
##########################################
- alias: 'Cameras Drive Way 1 Picture'
trigger:
- platform: state
entity_id: binary_sensor.driveway_1_line_crossing
to: 'on'
condition:
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.cameras_drive_way_1_picture.attributes.last_triggered) | int > 60 }}'
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.cameras_drive_way_2_picture.attributes.last_triggered) | int > 60 }}'
action:
- service: script.turn_on
entity_id: script.capture_driveway1_camera
- delay: '00:00:05'
- service: notify.pushbullet_notifications
data:
message: Drive Way Line Crossing from 24th Street
target:
- !secret pauls_secret_email
- !secret tracys_secret_email
title: DRIVEWAY 1 NOTIFICATION
data:
file: "/tmp/driveway1.jpg"
- alias: 'Cameras Drive Way 2 Picture'
trigger:
- platform: state
entity_id: binary_sensor.driveway_2_line_crossing
to: 'on'
condition:
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.cameras_drive_way_2_picture.attributes.last_triggered) | int > 60 }}'
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.cameras_drive_way_1_picture.attributes.last_triggered) | int > 60 }}'
action:
- service: script.turn_on
entity_id: script.capture_driveway2_camera
- delay: '00:00:02'
- service: notify.pushbullet_notifications
data:
message: Drive Way Line Crossing from the Half Street
target:
- !secret pauls_secret_email
- !secret tracys_secret_email
title: DRIVEWAY 2 NOTIFICATION
data:
file: "/tmp/driveway2.jpg"
- alias: 'Cameras Back Gate Picture'
trigger:
- platform: state
entity_id: binary_sensor.backyard_line_crossing
to: 'on'
condition:
- condition: state
# Back Door Open Close Sensor
entity_id: binary_sensor.open_close_sensor_back_door
state: 'off'
for:
minutes: 2
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.cameras_back_gate_picture.attributes.last_triggered) | int > 60 }}'
action:
- service: script.turn_on
entity_id: script.capture_backgate_camera
- delay: '00:00:02'
- service: notify.pushbullet_notifications
data:
message: Backgate Line Crossing
target:
- !secret pauls_secret_email
- !secret tracys_secret_email
title: BACKGATE NOTIFICATION
data:
file: "/tmp/backgate.jpg"
- alias: 'Camera Side Yard Picture'
trigger:
- platform: state
entity_id: binary_sensor.sideyard_line_crossing
to: 'on'
condition:
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.automation.cameras_side_yard_picture.attributes.last_triggered) | int > 60 }}'
action:
- service: script.turn_on
entity_id: script.capture_sideyard_camera
- delay: '00:00:02'
- service: notify.pushbullet_notifications
data:
message: Sideyard Line Crossing
target:
- !secret pauls_secret_email
- !secret tracys_secret_email
title: SIDEYARD NOTIFICATION
data:
file: "/tmp/sideyard.jpg"
I dont have access to the python script at the moment, but its in one of the posts in the community. Also i set this up when I first got started with HA, its possible (even likely), this could be simplified.
I did have them all in one script but found that it took a couple seconds to capture the images, and only needed a new image if there was a reason, so I broke it up
ptdalen, did you by chance have any dome cameras that were 720p? My 4MP turrets show up fine but the older domes donāt work. wonder if it requires 16:9 aspect ratio?
Sorry for resurrecting this threadā¦ Iām trying to get the Motion switch (components/switch/hikvisioncam.py) going.
However, I seem on getting a 401 error, even when Iām using the same admin username and password that I log in (and configured for the binary sensor). When I tested the same URL (http:///MotionDetection/1// in Postman with basic authentication, it fails as well (also a 401 error).
But if I do it from a browser where Iāve already logged in, I get the XML config for motion control back fine without an error.
Anyone notice these sensors not accurately reporting? Like I have multiple motion events recorded locally but HA motion sensor reports last motion event over 12 hours ago??
I am getting motion events on my motion sensor, just not as frequently as I am getting actual motion recordings?
Iāve had issues from time to time where the sensors seem to stop reporting. If I restart HA everything seems to start working again. I have not troubleshot much further, but the other day when it happened i was able to trace it back to a power outage I had in my house earlier. I believe that my HA instance came back up before my Cameras.
I am still testing, and not 100% positive, but it appears as if the Home Assistant threshold for motion is higher than the Hikvision threshold to record. I played with one of my motion zones today. I raised the sensitivity and lowered the percentage until the home assistant sensor tripped consistently. I then went back and noticed that there were recordings the entire time I was testing.
I understand this doesnāt make sense with the way the sensor is designed though.
I will say, I found motion alerts just way to finickey (even on the camera). I mostly use line crossing alerts, or a combination of line crossing and motion (via automation). Line crossing seems very accurate. I still get false positives, but much less often. One automation I do, is I only trigger on motion, if there was a line crossing, I then out the line crossing a bit away from the motion area. That works pretty well for me.
Why ? After restart HA show OFF and when before camera i run motion again still ONā¦ and not change to OFF.
I use camera Hikvision DS-2CD2063G0-I with latest firmware 5.5.82