#Upcoming Holidays Automations

1 messages · Page 1 of 1 (latest)

gaunt bolt
#

I was using the Calendarific integration that was in HACS, but it has disappeared... not sure if it was intentionally removed and I could re-add it manually, but it hasn't been updated in a few years.

Got me curious what others are using for "upcoming holidays?" The official Holiday integration isn't very helpful, as it only shows the next holiday, and I want to be able to do stuff, e.g. turn on Thanksgiving themed stuff for 20 days up to Thanksgiving and then stop. But things like Veteran's Day interferes with that.

So what are other people doing?

soft compass
#

I sadly don't have an answer either but would be interested as well. I'd like to automate my lights for colors based on the Holiday.

exotic ridge
#

There's a native "online calendar" integration (I think it's native, maybe HACS) and there's plenty of online calendars (just google "holiday calendar url") and then copy and paste the link.

#

And then you can use it in the calendar

#

Or ChatGPT can make an integration (or there's probably a HACS integration) that retrieves the next holiday and displays it nicely.

gaunt bolt
#

But that isn't good enough for my use-case. I did look into having ChatGPT (I use Claude) just create a bunch of holidays for me. Some holidays are rather complicated, but Claude seems to think this will work for Thanksgiving:

template:
  - binary_sensor:
      - name: "Thanksgiving Season"
        state: >
          {% set year = now().year %}
          {% set nov_first = strptime(year ~ '-11-01', '%Y-%m-%d') %}
          {% set first_thursday = nov_first + timedelta(days=(3 - nov_first.weekday()) % 7) %}
          {% set thanksgiving = first_thursday + timedelta(days=21) %}
          {% set today = now().date() %}
          {% set days_until = (thanksgiving.date() - today).days %}
          {{ 0 <= days_until <= 25 }}