Notification Garbage Collection Calendar Day before doesn’t work

I have a Garbage Collection calendar
The Garbage Collection Card works
image

It shows
image

Now I make this

alias: Garbage Out
description: ""
trigger:
  - platform: calendar
    event: start
    offset: "-6:0:0"
    entity_id: calendar.garbage_collection
condition: []
action:
  - service: script.announce
    data:
      message: Garbage Out
      speakers:
        - media_player.living_room_group
mode: single


And it never ever triggered
No traces found

What is wrong with it?

trigger:
  - platform: calendar
    event: start
    offset: "-06:00:00"

Thanks I will try that, although the Yamlr was created from the gui

THat didn’t work either. But it says this

image

17hrs but didn’t trigger? What does it mean?

Is the entity id correct?

image

I assume so, I did it all by gui.

Watchman isn’t saying anything.

Is this the only event you have in the calendar?

Yes, it’s created by the Garbage Collection so I can’t change it.

Maybe I dump it and use my local cal.

That would be a good idea because it has reached end of support.

Your problem is that your calendar trigger does not check for which event started.

The easiest way around this is to create a separate calendar for each type of waste collection you have. e.g

I use these in triggered template sensors but you can use them in automations too.

template:
- trigger:
  - platform: calendar
    event: start
    entity_id: calendar.green_waste_collection
    offset: -24:00:00
    id: "green waste tomorrow"
  - platform: calendar
    event: start
    entity_id: calendar.green_waste_collection
    id: "green waste today"
  - platform: calendar
    event: end
    entity_id: calendar.green_waste_collection
    id: "off"
  - platform: calendar
    event: start
    entity_id: calendar.recycling_collection
    offset: -24:00:00
    id: "recycling tomorrow"
  - platform: calendar
    event: start
    entity_id: calendar.recycling_collection
    id: "recycling today"
  - platform: calendar
    event: end
    entity_id: calendar.recycling_collection
    id: "off"
  sensor:
    - name: Garbage Collection
      state: "{{ trigger.id }}"
      icon: mdi:trash-can

1 Like

Thanks. Where can I create these in the UI?

image
I’d need to replace the card showing which bin as well.

You can not. You have to use YAML.

Thanks.
I did it in yaml.

In the UI, you can do

condition: state
entity_id: calendar.local_calendar
attribute: message
state: Red Bin

To check the message, can I do this with the template sensors? I couldn’t find an autocomplete for it.

So to do state: “{{ trigger.id }} + message” or something?

And can I do the color of the icon to simulate the old card?

"{{ is_state_attr('calendar.local_calendar', 'message', 'Red Bin') }}"

Thanks.
I can see 1 issue. If HA is rebooted, there is no trigger. The sensor will then have no state until the next week?
To display the next week, I’d be using

  - platform: calendar
    event: start
    entity_id: calendar.garbage_collection
    offset: -144:00:00

I think the addon was more elegant but too bad…
I’ll put in a mix of automations and helpers.

Triggered template sensors are restored after a restart.

Did you get yours working similar to before? I used Tom’s sample code above and I am not getting close to what I had.

Thanks.

How is everyone moving the garbage collection based on holidays? That was the biggest item I liked about the Garbage Collection as it would move the collection event a day ahead if the holiday was in the week.

The council here still collects on holidays.

Most countries/states do not. I have been attempting to create an automation based on the blueprints of @bruxy70 but I can’t seem to programmatically edit an event in a local calendar.