alias: Turn on light at 05:15 on weekdays (excluding holidays)
description: Turns on the specified light every weekday at 5:15 AM unless it is a holiday
triggers:
at: “05:15:00”
trigger: time
conditions:
condition: time
weekday:
mon
tue
wed
thu
fri
condition: state
entity_id: calendar.helgdagar_i_sverige
state: “off”
attribute: all_day
actions:
target:
entity_id: scene.godmorgon
action: scene.turn_on
data: {}
mode: single
Other than your formatting, it looks correct to me!
alias: Turn on light at 05:15 on weekdays (excluding holidays)
description: Turns on the specified light every weekday at 5:15 AM unless it is a holiday
trigger:
- platform: time
at: "05:15:00"
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: state
entity_id: calendar.helgdagar_i_sverige
state: "off"
attribute: all_day
action:
- service: scene.turn_on
target:
entity_id: scene.godmorgon
mode: single
Thanks for your reply. I am unsure if the “state: “off”
attribute: all_day” is the condition i want. I would like the binary to go to “on” if its a holiday. I am new to HA and learning every day.
Also, a side note, when does the light get turned off every day? Is it manually being turned off every day? Or else, once it turns on, it will remain on all the time unless it’s a holiday.
I use door sensors on the bedroom doors to turn on the lights in the house in the morning. That way the lights turn on right when you need them, regardless of when you wake up.
And the code I provided is correct. If you don’t wan the lights to turn on when it’s a holiday, the code I gave you is the correct way to do that.
By changing “off” to “on”, it means on a holiday, it would turn them ON… which would be redundant since you have them turn on every day of the week anyway.
go to calendar.google.com and then click on the ‘+’ next to other Calendars in the bottom left of the page. Then click on Subscribe and paste the address above into the box.
When you’re done testing, simply unsubscribe to that new calendar.