Hi Everyone
I have an automation that shuts down my Plex Server and NAS at 22:05 each evening, unless there is a stream active. Option 3 of the Automation is supposed to check between 22:05 - 00:00 and if not stream is active for 15 minutes then shutdown. I can not get this last past to work. Could someone point out the errors of my way?
description: ""
triggers:
- at: "22:05:00"
id: Shut Down
trigger: time
- trigger: state
entity_id:
- sensor.plex_media_server
for:
hours: 0
minutes: 0
seconds: 0
id: No Activity
to: "0"
- trigger: webhook
allowed_methods:
- POST
- PUT
- HEAD
- GET
local_only: false
webhook_id: watch-plex-activity-shutdown-xxxxxxxxxxxxxxxxxxxxxxxx
id: Webhook
conditions:
- condition: state
entity_id: input_boolean.vacation_mode
state: "off"
enabled: true
- condition: state
entity_id: input_boolean.guest_mode
state: "off"
actions:
- choose:
- conditions:
- condition: trigger
id:
- Shut Down
- Webhook
- condition: numeric_state
entity_id: sensor.plex_media_server
below: 1
sequence:
- data: {}
action: shell_command.nas_shutdown
- data: {}
action: rest_command.nuc_shutdown
- conditions:
- condition: trigger
id:
- Shut Down
- Webhook
- condition: numeric_state
entity_id: sensor.plex_media_server
above: 0
sequence:
- metadata: {}
data:
message: Plex shutdown overridden due to current activity.
action: notify.notify
- conditions:
- condition: trigger
id:
- No Activity
- condition: and
conditions:
- condition: time
after: "22:05:00"
before: "00:00:00"
- condition: state
entity_id: sensor.plex_media_server
for:
hours: 0
minutes: 15
seconds: 0
state: "0"
sequence:
- data: {}
action: shell_command.nas_shutdown
- data: {}
action: rest_command.nuc_shutdown
mode: single