Files
fresh-home/automations/cameras/frigate_snapshots.yaml
T
2024-04-14 14:08:56 -04:00

109 lines
3.1 KiB
YAML

alias: Frigate Snapshots
id: automation_frigate_snapshots
mode: restart
trigger:
- platform: homeassistant
event: start
- id: automatic
platform: time_pattern
minutes: "/10"
- id: boolean
platform: state
entity_id: input_boolean.debug_snapshots
- id: indoors
platform: state
entity_id: input_boolean.indoor_snapshots
- id: outdoors
platform: state
entity_id: input_boolean.outdoor_snapshots
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.debug_snapshots
state: 'on'
sequence:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.frigate_cam01_snapshots
- switch.frigate_cam03_snapshots
- switch.frigate_cam04_snapshots
- switch.frigate_cam06_snapshots
- switch.frigate_cam07_snapshots
- switch.frigate_cam08_snapshots
- switch.frigate_cam12_snapshots
- switch.frigate_cam13_snapshots
- switch.frigate_cam14_snapshots
- switch.frigate_cam18_snapshots
- switch.frigate_cam19_snapshots
- choose:
- conditions:
- condition: state
entity_id: input_boolean.indoor_snapshots
state: 'on'
sequence:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.frigate_cam01_snapshots
- switch.frigate_cam03_snapshots
- switch.frigate_cam06_snapshots
- switch.frigate_cam07_snapshots
- switch.frigate_cam08_snapshots
- switch.frigate_cam12_snapshots
- switch.frigate_cam13_snapshots
- conditions:
- condition: state
entity_id: input_boolean.indoor_snapshots
state: 'off'
sequence:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.frigate_cam01_snapshots
- switch.frigate_cam03_snapshots
- switch.frigate_cam06_snapshots
- switch.frigate_cam07_snapshots
- switch.frigate_cam08_snapshots
- switch.frigate_cam12_snapshots
- switch.frigate_cam13_snapshots
- choose:
- conditions:
- condition: state
entity_id: input_boolean.outdoor_snapshots
state: 'on'
sequence:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.frigate_cam04_snapshots
- switch.frigate_cam14_snapshots
- switch.frigate_cam18_snapshots
- switch.frigate_cam19_snapshots
- conditions:
- condition: state
entity_id: input_boolean.outdoor_snapshots
state: 'off'
sequence:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.frigate_cam04_snapshots
- switch.frigate_cam14_snapshots
- switch.frigate_cam18_snapshots
- switch.frigate_cam19_snapshots