Qui sotto la configurazione dei vari file:
camera.yaml
- platform: generic
name: "Foscam Ingresso"
stream_source: !secret camera_Ingresso_rtsp
still_image_url: !secret camera_Ingresso_image
verify_ssl: false
switch.yaml
- platform: command_line
switches:
ptz_foscam:
command_on: !secret camera_Ingresso_On
command_off: !secret camera_Ingresso_Off
friendly_name: PTZ Camera-Ingresso
secret.yaml
camera_Ingresso_PIR: "/usr/bin/curl -X GET 'http://IP:PORT/cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=USERNAME&pwd=PASSWORD'"
camera_Ingresso_rtsp: rtsp://USERNAME:PASSWORD@IP:PORT/videoSub #videoMain
camera_Ingresso_image: http://IP:PORT/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=USERNAME&pwd=PASSWORD
camera_Ingresso_On: "/usr/bin/curl -X GET 'http://IP:PORT/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=New&usr=USERNAME&pwd=PASSWORD'"
camera_Ingresso_Off: "/usr/bin/curl -X GET 'http://IP:PORT/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Koridor&usr=USERNAME&pwd=PASSWORD'"
configuration.yaml
whitelist_external_dirs:
- '/config/camera'
automation.yaml
- id: 6e51a953fcc34c569f5c16a7541c3054
alias: Ingresso Camera snapshot
trigger:
- entity_id: sensor.foscam_pir
from: 'False'
platform: state
to: 'True'
condition: []
action:
- delay: 00:00:02
- data:
entity_id: camera.foscam_ingresso
filename: /config/camera/snapshot.jpg
service: camera.snapshot
- delay: 00:00:01
- data:
data:
photo:
caption: Motion Detected.
file: /config/camera/snapshot.jpg
message: Motion Detected.
service: notify.ha_notifiche-Genitori
sensor.yaml
- platform: command_line
name: Foscam PIR
command: !secret camera_Ingresso_PIR
value_template: "{{ value | regex_findall_index('<motionDetectAlarm>(.*)</motionDetectAlarm>') == '2' }}"
scan_interval: 20
command_timeout: 120
script.yaml
detection_motion:
alias: Ingresso Camera Motion Detection ON
sequence:
- service: automation.trigger
entity_id: automation.Ingresso_camera_snapshot
[attachment=143]