Skip to content

Instantly share code, notes, and snippets.

@polishdeveloper
Created October 3, 2018 20:31
Show Gist options
  • Save polishdeveloper/37360f82810d60f9d64cee14e13bd2da to your computer and use it in GitHub Desktop.
Save polishdeveloper/37360f82810d60f9d64cee14e13bd2da to your computer and use it in GitHub Desktop.
Sample HA config for Hikvision Camera - camera preview + motion detection and automation to switch off lights using rf switch when there is no motion for 15 mins
ffmpeg:
camera:
- platform: mjpeg
mjpeg_url: http://192.168.202.183/Streaming/channels/2/preview
username: !secret hikvision_user
password: !secret hikvision_pass
binary_sensor:
# Hallway
- platform: hikvision
name: hallway_motion
host: 192.168.202.183
username: !secret hikvision_user
password: !secret hikvision_pass
customize:
motion:
delay: 30
line_crossing:
ignored: True
face_detection:
ignored: True
tamper_detection:
ignored: True
field_detection:
ignored: True
switch:
- platform: rpi_rf
gpio: 22
switches:
hallway_light:
code_on: 15983128
code_off: 15983124
automation:
- alias: Motion detection - Hallway lights off
trigger:
platform: state
entity_id: binary_sensor.hallway_motion
to: 'off'
for:
minutes: 15
action:
service: homeassistant.turn_off
entity_id: switch.hallway_light
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment