Scripting for Calendar Events

I know we can use automation on calendar events, but I am trying to replace the now depreciated Garbage Collection HACS add-on (that I loved and am sad to see go) in scripting.

Using the add-on it was simple to just check the sensor that was created to see if today was a garbage day or “garbage reminder” day, and it was pretty awesome because it could factor in holidays and move the trash day up a day. Now, however, I’m not sure how to replicate this using just calendars in HA.

I set up a new iCloud calendar to sync to HA calendars with all the trash pickup days but don’t know how to utilize a template sensor to see if today is trash day. The only examples I can find about working with calendars is all about automation, rather than scripts. The reason why I want to do it this way is I have a “wake up announcement” that currently reads the add-on sensor and if it’s on then my wake up announcement tacks on “today is garbage collection day”. I know I could do automation for a certain event at a specific date and time, but I don’t want a second announcement.

Any thoughts? The only other thing I can think of is using automation and toggling a sensor on and off based on an event triggering it, but does that work for all-day events?

Have you solved this?

i must be misunderstanding your question… but why isn’t:

{{ states(‘schedule.garbage_day’) }}

what you want? it should be true when it’s trash day and false when it’s not? so your wake up announcement script can just read that value.

I posted this question in May 2023…

That being said, I’ve since resolved my issue using Calendar triggers based on the name of the event and the calendar it came from to toggle a helper and it’s worked a treat since.

But it’s nice to know someone replied to it nearly a year after I asked it, lol. Fortunately I’m fairly resourceful!