I’m exploring the use of schedule helpers. My use case is a plug switch that I’d like to turn off/on at a regular schedule - seems perfect for a helper, right? Here is the general automation code:
id: 'readinglight'
alias: 'Reading Light'
trigger:
- platform: state
entity_id: schedule.bedroom_light
condition:
- condition: template
value_template: "{{ trigger.to_state.state != 'unavailable' }}"
- condition: template
value_template: "{{ trigger.to_state.state != 'unknown' }}"
action:
- service: >
switch.turn_{{ trigger.to_state.state }}
entity_id: switch.bedroom_light
I need the unavailable and unknown conditions because they effectively map to “off” during a home assistant reboot.
I have recently become aware of the scheduler custom component and and custom card, I’ll likely explore that further, but I’m first just trying to stick to core home assistant.
This seems like it would be a fairly common task. My question is - Is there a better way to do this, or an operator or service I’m not aware of that would more directly map a schedule to a device/entity, using core home assistant?
Thanks!