Files
fresh-home/automations/house/update_light_off_delay.yaml
2025-10-10 20:24:52 -04:00

269 lines
8.4 KiB
YAML

alias: Update Light Off Delay
id: automation_update_light_off_delay
mode: queued
# Detect when something changes and/or when Home Assistant Starts
trigger:
- platform: state
entity_id: input_select.house
- platform: homeassistant
event: start
action:
- choose:
- alias: "House set to Away"
conditions:
- condition: state
entity_id: input_select.house
state: "Away"
sequence:
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_seconds
data:
value: 30
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_minutes
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_minutes
data:
value: 5
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_minutes
data:
value: 30
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_hours
data:
value: 0
- alias: "House set to Bachelor - 10 minutes"
conditions:
- condition: state
entity_id: input_select.house
state: "Bachelor"
sequence:
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_minutes
data:
value: 1
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_minutes
data:
value: 10
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_minutes
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_hours
data:
value: 1
- alias: "House set to Guest - 30 minutes"
conditions:
- condition: state
entity_id: input_select.house
state: "Manual"
sequence:
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_minutes
data:
value: 10
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_minutes
data:
value: 30
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_minutes
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_hours
data:
value: 1
- alias: "House set to Manual - 60 minutes"
conditions:
- condition: state
entity_id: input_select.house
state: "Manual"
sequence:
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_minutes
data:
value: 20
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_minutes
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_hours
data:
value: 1
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_minutes
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_hours
data:
value: 2
default:
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_minutes
data:
value: 10
- action: input_number.set_value
target:
entity_id: input_number.short_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_minutes
data:
value: 30
- action: input_number.set_value
target:
entity_id: input_number.normal_light_off_delay_hours
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_seconds
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_minutes
data:
value: 0
- action: input_number.set_value
target:
entity_id: input_number.long_light_off_delay_hours
data:
value: 1