I have a Garbage Collection calendar
The Garbage Collection Card works
It shows
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?
tom_l
April 9, 2023, 4:24am
2
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
17hrs but didn’t trigger? What does it mean?
tom_l
April 12, 2023, 2:20am
5
Is the entity id correct?
I assume so, I did it all by gui.
Watchman isn’t saying anything.
tom_l
April 12, 2023, 2:27am
7
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.
tom_l
April 12, 2023, 2:56am
9
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?
I’d need to replace the card showing which bin as well.
tom_l
April 12, 2023, 3:08am
11
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?
tom_l
April 12, 2023, 6:32am
13
"{{ 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.
tom_l
April 12, 2023, 10:53am
15
Triggered template sensors are restored after a restart.
bschatzow
(Bill Schatzow)
May 2, 2023, 7:44pm
16
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.
tom_l
May 4, 2023, 1:32am
18
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.