Files
Home-Assistant/automations/01_home_and_lighting/01d_outside_automations.yaml
T
Joshua KingandCursor 651b37e37a Turn porch decorations on when the schedule is run manually.
A manual run has no trigger id, so the sunset branch never matched and Right Porch Outlet 2 stayed off.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-02 19:55:50 -05:00

110 lines
3.2 KiB
YAML

################################################
############## OUTSIDE AUTOMATIONS #############
################################################
- id: '1769311377293'
alias: Front Porch outlets turn off at 10P
description: ''
triggers:
- trigger: time
at: '22:00:00'
conditions: []
actions:
- type: turn_off
device_id: e04306aa947ba9901108c363d8109ca0
entity_id: 12662d2294935b2a21500e3f6d69ba15
domain: switch
# Lamppost shutoff moved to Porch Decorations Schedule below.
# - type: turn_off
# device_id: c0de273e40c6f4f1cafe4db27e5a6782
# entity_id: e6f4af2d9bc05634f994af34bad9a477
# domain: switch
- type: turn_off
device_id: e2343a74462cc1434c4acfa2e32d1364
entity_id: ea84e174f0fa3316b9923c4254454a37
domain: switch
mode: single
- id: porch_decorations_schedule
alias: Porch Decorations Schedule
description: >-
Turn on Porch Decorations 1, Porch Decor 1, Porch Decor 2, Porch Decor 3,
Porch Decor 1 Smart Plug, and Right Porch Outlet 2 one hour before sunset.
Turn them off at 22:30 Sunday through Thursday and at 23:45 Friday and
Saturday, along with the Outside Lamppost.
mode: single
triggers:
- trigger: sun
event: sunset
offset: "-01:00:00"
id: decorations_on
- trigger: time
at: "22:30:00"
id: decorations_off_weeknight
- trigger: time
at: "23:45:00"
id: decorations_off_weekend
conditions: []
actions:
- choose:
- conditions:
- condition: or
conditions:
- condition: trigger
id: decorations_on
# A manual run has no trigger id. Treat it as the sunset turn-on.
- condition: template
value_template: "{{ trigger.id | default(none) is none }}"
sequence:
- action: switch.turn_on
continue_on_error: true
target:
entity_id:
- switch.washing_machine_socket_1
- switch.porch_fan_socket_1
- switch.big_family_room_lamp
- switch.studio_plug_1_2
- switch.porch_decorations_3
- switch.outside_right_porch_outlet_2
- conditions:
- condition: trigger
id: decorations_off_weeknight
- condition: time
weekday:
- sun
- mon
- tue
- wed
- thu
sequence:
- action: switch.turn_off
continue_on_error: true
target:
entity_id:
- switch.washing_machine_socket_1
- switch.porch_fan_socket_1
- switch.big_family_room_lamp
- switch.studio_plug_1_2
- switch.porch_decorations_3
- switch.outside_right_porch_outlet_2
- switch.outside_lamppost
- conditions:
- condition: trigger
id: decorations_off_weekend
- condition: time
weekday:
- fri
- sat
sequence:
- action: switch.turn_off
continue_on_error: true
target:
entity_id:
- switch.washing_machine_socket_1
- switch.porch_fan_socket_1
- switch.big_family_room_lamp
- switch.studio_plug_1_2
- switch.porch_decorations_3
- switch.outside_right_porch_outlet_2
- switch.outside_lamppost