Created
July 3, 2023 21:07
-
-
Save allenporter/f861ac5829061d3d9abf7c30a4d3a4cf to your computer and use it in GitHub Desktop.
Use a calendar to control when a switch should be turned on/off
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Switch on Calendar | |
description: Use a calendar for managing a switch schedule. Switch is turned on according the calendar schedule. | |
domain: automation | |
input: | |
calendar_sensor: | |
name: Calendar Sensor | |
selector: | |
entity: | |
domain: | |
- calendar | |
- binary_sensor | |
target_switch: | |
name: Switch | |
selector: | |
target: | |
entity: | |
domain: switch | |
variables: | |
cal_switch: !input calendar_sensor | |
trigger: | |
- platform: state | |
entity_id: !input calendar_sensor | |
action: | |
service: "{{ iif(is_state(cal_switch, 'on'), 'switch.turn_on', 'switch.turn_off') }}" | |
target: !input target_switch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment