Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################################
- ## Cameras
- ################################################################
- ################################################
- ## Camera component
- ################################################
- camera:
- - platform: generic
- still_image_url: !secret cam_backdoor
- stream_source: !secret cam_backdoor_rtsp
- name: BackDoor
- - platform: generic
- still_image_url: !secret cam_frontdoor
- stream_source: !secret cam_frontdoor_rtsp
- name: FrontDoor
- - platform: generic
- still_image_url: !secret cam_patio
- stream_source: !secret cam_patio_rtsp
- name: Patio
- ################################################
- ## Image Processing
- ################################################
- image_processing:
- - platform: tensorflow
- source:
- - entity_id: camera.backdoor
- - entity_id: camera.frontdoor
- - entity_id: camera.patio
- file_out:
- - "/config/www/tensorflow/{{ camera_entity.split('.')[1] }}_latest.jpg"
- - "/config/www/tensorflow/{{ camera_entity.split('.')[1] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}.jpg"
- scan_interval: 604800
- model:
- graph: /config/tensorflow/frozen_inference_graph.pb
- categories:
- - person
- ################################################
- ## Input boolean
- ################################################
- input_boolean:
- camgrab_backdoor:
- name: camgrab_backdoor
- initial: off
- icon: mdi:camera
- camgrab_frontdoor:
- name: camgrab_frontdoor
- initial: off
- icon: mdi:camera
- camgrab_patio:
- name: camgrab_patio
- initial: off
- icon: mdi:camera
- ################################################
- ## Shell Command
- ## Captures a 5 sec video and toggles input_boolean.cameragrab off when done
- ################################################
- shell_command:
- backdoor_ipcam_mp4: bash -x /config/shell-scripts/backdoor_ipcam2mp4.sh >> /config/ffmpeg/ipcam2.log 2>&1
- frontdoor_ipcam_mp4: bash -x /config/shell-scripts/frontdoor_ipcam2mp4.sh >> /config/ffmpeg/ipcam2.log 2>&1
- camerafilechanged: bash -x /config/shell-scripts/camerafilechanged.sh
- ################################################
- ## Binary Sensors
- ################################################
- binary_sensor:
- - platform: hikvision
- host: 192.168.1.185
- username: !secret cam_hikvision_usr
- password: !secret cam_hikvision_pw
- name: Backdoor_movement
- ssl: false
- customize:
- motion:
- delay: 30
- line_crossing:
- delay: 30
- field_detection:
- delay: 30
- - platform: hikvision
- host: 192.168.1.186
- name: Frontdoor_movement
- username: !secret cam_hikvision_usr
- password: !secret cam_hikvision_pw
- ssl: false
- customize:
- motion:
- delay: 30
- line_crossing:
- delay: 30
- - platform: hikvision
- host: 192.168.1.187
- name: Patio_movement
- username: !secret cam_hikvision_usr
- password: !secret cam_hikvision_pw
- ssl: false
- customize:
- motion:
- delay: 30
- field_detection:
- delay: 30
- ################################################
- ## Automation
- ################################################
- automation:
- - id: movement_backdoor
- alias: Movement backdoor
- initial_state: false
- hide_entity: False
- trigger:
- - platform: state
- entity_id: binary_sensor.backdoor_movement_field_detection
- from: 'off'
- to: 'on'
- condition:
- - condition: state
- entity_id: alarm_control_panel.home_alarm
- state: armed
- action:
- - service: camera.snapshot
- data:
- entity_id: camera.backdoor
- filename: '/config/www/backdoor.jpg'
- - service: input_boolean.turn_on
- data:
- entity_id: input_boolean.camgrab_backdoor
- - service: shell_command.backdoor_ipcam_mp4
- - wait_template: "{{ is_state('input_boolean.camgrab_backdoor', 'off') }}"
- - service: notify.telegram
- data:
- title: Movement Backdoor
- message: "Movement Backdoor"
- data:
- video:
- - file: /config/www/backdoor-output.mp4
- caption: Backdoor movement
- - id: movement_frontdoor
- alias: Movement frontdoor
- initial_state: false
- hide_entity: False
- trigger:
- - platform: state
- entity_id: binary_sensor.frontdoor_movement_line_crossing
- from: 'off'
- to: 'on'
- condition:
- - condition: state
- entity_id: alarm_control_panel.home_alarm
- state: disarmed
- action:
- - service: camera.snapshot
- data:
- entity_id: camera.frontdoor
- filename: '/config/www/frontdoor.jpg'
- - service: input_boolean.turn_on
- data:
- entity_id: input_boolean.camgrab_frontdoor
- - service: shell_command.frontdoor_ipcam_mp4
- - wait_template: "{{ is_state('input_boolean.camgrab_frontdoor', 'off') }}"
- - service: notify.telegram
- data:
- title: Movement Frontdoor
- message: "Movement frontdoor"
- data:
- video:
- - file: /config/www/frontdoor-output.mp4
- caption: Frontdoor movement
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement