Skip to content

Instantly share code, notes, and snippets.

@SirEndii
Last active May 17, 2025 17:48
Show Gist options
  • Select an option

  • Save SirEndii/af42ae6c7d3354d42c037ac41945d293 to your computer and use it in GitHub Desktop.

Select an option

Save SirEndii/af42ae6c7d3354d42c037ac41945d293 to your computer and use it in GitHub Desktop.
Home assistant day time automation
blueprint:
name: Scheduled Actions with Weekday Filter
description: Turn on/off a device at specific times on selected weekdays.
domain: automation
input:
device_to_control:
name: Device
description: The device to control (light, switch, etc.).
selector:
entity: {}
turn_on_time:
name: Turn On Time
description: The time to turn the device on (HH:MM).
selector:
time: {}
turn_on_weekdays:
name: Turn On Weekdays
description: Select the weekdays to turn the device on.
selector:
select:
options:
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
- Sun
multiple: true
turn_on_action:
name: Turn On Action (Optional)
description: Actions to perform when turning on the device (e.g., brightness, color).
selector:
action: {}
default: []
turn_off_time:
name: Turn Off Time
description: The time to turn the device off (HH:MM).
selector:
time: {}
turn_off_weekdays:
name: Turn Off Weekdays
description: Select the weekdays to turn the device off.
selector:
select:
options:
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
- Sun
multiple: true
turn_off_action:
name: Turn Off Action (Optional)
description: Actions to perform when turning off the device.
selector:
action: {}
default: []
trigger:
- platform: time
at: !input turn_on_time
- platform: time
at: !input turn_off_time
condition:
- condition: or
conditions:
- condition: and
conditions:
- condition: trigger
id:
- '0' # Trigger ID for turn_on_time
- condition: time
weekday: !input turn_on_weekdays
- condition: and
conditions:
- condition: trigger
id:
- '1' # Trigger ID for turn_off_time
- condition: time
weekday: !input turn_off_weekdays
action:
- choose:
- conditions:
- condition: trigger
id: '0'
then:
- service: homeassistant.turn_on
target:
entity_id: !input device_to_control
- choose:
- conditions:
- condition: template
value_template: "{{ turn_on_action }}"
then: !input turn_on_action
default:
- service: homeassistant.turn_off
target:
entity_id: !input device_to_control
- choose:
- conditions:
- condition: template
value_template: "{{ turn_off_action }}"
then: !input turn_off_action
mode: parallel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment