Hello,
I have a trash reminder notification in place. Trash day is Thursday. However, if there is a holiday during the week, it is delayed a day. I am having an issue with the second part of this code not firing correctly.
For instance, Christmas day was a Sunday, and I received my notification on a Friday, not Thursday to put the trash out. Google Calendar shows “Christmas Day (substitute)” on 12/26 and am not sure if the IN section of the code had a problem with that.
The sensor: sensor.holidays_calendar is the name of the holiday used in the Google Holiday Calendar. It seems to change around 10 min after midnight.
- alias: Holiday Trash Delay
initial_state: true
trigger:
platform: template
value_template: >
{{(is_state('calendar.holidays_in_united_states', 'on') and states('sensor.holidays_calendar') in ['Memorial Day','Labor Day'])
or (is_state('calendar.holidays_in_united_states', 'on') and states('sensor.holidays_calendar') in ['Independence Day','Christmas Day', "New Year's Day"] and now().isoweekday() in (1,2,3,4))}}
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.trash_offset
Do you think using this method here would work?
- alias: Holiday Trash Delay
initial_state: true
trigger:
platform: calendar
event: start
entity_id: calendar.holidays_in_united_states
offset: "00:25:00"
value_template: >
{{ (trigger.calendar_event.summary in ['Memorial Day','Labor Day','Independence Day','Christmas Day', "New Year's Day"] and now().isoweekday() in (1,2,3,4))
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.trash_offset