I have now tried everything and it does not work in automation even if the entity state is “on”. Maybe you can test?
I’ve been testing many ways, and it’s not working for me either.
Got it!
alias: Turn on light at 05:15 on weekdays (excluding holidays)
description: ""
mode: single
trigger:
- platform: time
at: "05:15:00"
conditions:
- condition: state
entity_id: calendar.holidays_in_montenegro
attribute: all_day
state: "true"
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: scene.turn_on
data:
entity_id: scene.godmorgon
This doesnt work. still get condition not passed
alias: Turn on light at 05:15 on weekdays (excluding holidays) Micke
description: ""
triggers:
- at: "12:53:00"
trigger: time
conditions:
- condition: state
entity_id: calendar.holidays_in_montenegro
attribute: all_day
state: "true"
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
actions:
- action: script.godmorgon_micke_script
data: {}
mode: single
I did change to run script instead and it work without the “holiday” condition.
It works for me using a simple light…
alias: A_Testing holiday lights on
description: ""
mode: single
trigger:
- platform: time
at: "05:15:00"
conditions:
- condition: state
entity_id: calendar.holidays_in_montenegro
attribute: all_day
state: "true"
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: light.turn_on
data:
entity_id: 4c848cf315964f7194eadec48ff89d86
It won’t turn on right now because today is a holiday.
You typed:
actions:
- action: script.godmorgon_micke_script
data: {}
mode: single
It should be:
action:
- service: scene.turn_on
target:
entity_id: scene.godmorgon
mode: single
Also, you typed:
triggers:
- at: "12:53:00"
trigger: time
It should be:
trigger:
- platform: time
at: "05:15:00"
Yea i know. i changed to if its holiday it should light up just to test. it doesnt work. And the other changes is just for testing the automation.
Just use the yaml I sent you. You can’t change things and then claim it doesn’t work. LOL
For testing… simply go “delete” that holiday in the calendar (it hides it - which can be unhidden later), and this will tell you if the lights will turn on when it’s not a holiday.
Otherwise they shouldn’t turn on today, according to it being a holiday.
And if you change top false it will light up?? Test that
Do you get “condition passed” in testing the automation?
Okay, I changed it up!
alias: A_Testing holiday lights on
description: ""
triggers:
- at: "05:15:00"
trigger: time
conditions: []
actions:
- choose:
- conditions:
- condition: state
entity_id: calendar.holidays_in_montenegro
attribute: description
state: Public holiday
enabled: true
sequence:
- stop: It's a holiday!!
enabled: true
- conditions:
- condition: time
weekday:
- sun
- sat
sequence:
- stop: Because it's the weekend!
- data: {}
action: light.turn_on
target:
entity_id: light.mirror_2
mode: single
Here’s your yaml:
alias: Turn on light at 05:15 on weekdays (excluding holidays)
description: ""
triggers:
- at: "05:15:00"
trigger: time
conditions: []
actions:
- choose:
- conditions:
- condition: state
entity_id: calendar.holidays_in_montenegro
attribute: description
state: Public holiday
enabled: true
sequence:
- stop: It's a holiday!!
enabled: true
- conditions:
- condition: time
weekday:
- sun
- sat
sequence:
- stop: Because it's the weekend!
- data: {}
action: scene.turn_on
target:
entity_id: scene.godmorgon
mode: single
What’s the verdict?
It work with that calendar. The one i use have different descriptions, due to different holidays.
Can you go to Developer Tools and click on States. Then down in the filter box, type in your calendar. Then take a screen print of the attributes?
I don’t understand this it says condition is true and state is true but false result. the only thing is this signs around wanted_state ‘true’ and state want state without signs.