Files
zorruno-homeassistant/packages/flounder_cctv_snapshots.yaml
T
2026-08-15 14:58:19 +12:00

45 lines
1.7 KiB
YAML

shell_command:
flounder_refresh_motioneye_snapshots: >-
python3 /config/scripts/flounder_motioneye_snapshots.py
"{{ state_attr('camera.camera2', 'entity_picture') }}"
"{{ state_attr('camera.camera5', 'entity_picture') }}"
"{{ state_attr('camera.camera6', 'entity_picture') }}"
"{{ state_attr('camera.trailer', 'entity_picture') }}"
"{{ state_attr('camera.camera4', 'entity_picture') }}"
flounder_refresh_primary_motioneye_snapshots: >-
python3 /config/scripts/flounder_motioneye_snapshots.py --primary
"{{ state_attr('camera.camera2', 'entity_picture') }}"
"{{ state_attr('camera.camera5', 'entity_picture') }}"
"{{ state_attr('camera.camera6', 'entity_picture') }}"
automation:
- id: flounder_refresh_motioneye_snapshots
alias: "Flounder: Refresh MotionEye snapshots"
description: >-
Sequentially refreshes durable local CCTV previews without loading live
streams in the kiosk browser.
triggers:
- trigger: time_pattern
minutes: "*"
id: tick
- trigger: state
entity_id: binary_sensor.flounder_kiosk_screen_on
from: "off"
to: "on"
id: screen_on
conditions:
- condition: state
entity_id: binary_sensor.flounder_kiosk_screen_on
state: "on"
actions:
- choose:
- conditions:
- condition: template
value_template: >-
{{ trigger.id == 'tick' and now().minute % 5 == 0 }}
sequence:
- action: shell_command.flounder_refresh_motioneye_snapshots
default:
- action: shell_command.flounder_refresh_primary_motioneye_snapshots
mode: single