How do i check that tomorrow is “Store bededag”
{{ states(‘calendar.helligdage_i_danmark’) }} is off , because I check it today
How do i check that tomorrow is “Store bededag”
{{ states(‘calendar.helligdage_i_danmark’) }} is off , because I check it today
You use the calendar.get_events
service. There are many threads on this topic available… here are some that are similar to your question:
https://community.home-assistant.io/t/send-email-if-specific-calendar-event-is-present/687111/2
https://community.home-assistant.io/t/variable-help/675071/2
https://community.home-assistant.io/t/automation-to-set-a-variable-based-on-tomorrows-calendar/672035/3
It would be easier to give you a more specific answer if you give us more details about what you are trying to do.
Thanks, I want to make a true / false condition if the work “Store bededag” is in the calendar tomorrow
do i have to make a sensor for that, or can it be done in a template?
Those are not mutually exclusive options…
Post the script or automation you want to add the condition to and describe, specifically, when the condition needs to pass and when it should fail.
alias: Ny pre ferie helligdag
description: ""
trigger:
- platform: calendar
event: start
offset: "-9:0:0"
entity_id: calendar.ferie
id: Ferie start
- platform: calendar
event: start
offset: "-9:0:5"
entity_id: calendar.helligdage_i_danmark
id: Helligdag start
- platform: calendar
event: end
entity_id: calendar.ferie
offset: "-9:0:5"
id: ferie slutter
- platform: calendar
event: start
offset: "-8:58:0"
entity_id: calendar.helligdage_i_danmark
id: Helligdag start 2 dage efter hinanden
- platform: calendar
event: end
offset: "-9:0:5"
entity_id: calendar.helligdage_i_danmark
id: Helligdag slutter
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: ferie slutter
sequence:
- service: input_boolean.turn_off
data: {}
target:
entity_id:
- input_boolean.pre_ferie
- conditions:
- condition: trigger
id: Helligdag slutter
sequence:
- service: input_boolean.turn_off
data: {}
target:
entity_id:
- input_boolean.pre_ferie
- conditions:
- condition: trigger
id: Helligdag start
sequence:
- service: input_boolean.turn_on
data: {}
target:
entity_id:
- input_boolean.pre_ferie
- conditions:
- condition: trigger
id: Ferie start
sequence:
- service: input_boolean.turn_on
data: {}
target:
entity_id:
- input_boolean.pre_ferie
- conditions:
- condition: trigger
id: Helligdag start 2 dage efter hinanden
sequence:
- service: input_boolean.turn_on
data: {}
target:
entity_id:
- input_boolean.pre_ferie
default: []
mode: restart
condition should check that the day tomorrow is not “Store bededag”
When using Calendar event triggers the event data is available as part of the trigger
variable. You do not need to use the calendar.get_events
service call or set up a sensor, you can use a normal template condition.
- condition: template
value_template: "{{ trigger.calendar_event.summary is search('Store bededag') }}"
thanks , i will try that.