Hi all,
I have the waste_collection_schedule installed on my home assistent instance.
and it loads all the garbage collection date’s in my calander, Now i’m trying to create a count down of each container (I got 4)
If i look in the development tool it tells me all the entry’s are called callender.waste_collection_***
In the message it tells me which container is being emptied
message: Groente-, fruit, tuinafval en etensresten
all_day: true
start_time: 2023-06-19 00:00:00
end_time: 2023-06-20 00:00:00
location:
description:
message: Plastic, blik en drinkpakken
all_day: true
start_time: 2023-06-19 00:00:00
end_time: 2023-06-20 00:00:00
location:
description:
message: Restafval
all_day: true
start_time: 2023-06-19 00:00:00
end_time: 2023-06-20 00:00:00
location:
description:
message: Papier en karton
all_day: true
start_time: 2023-06-19 00:00:00
end_time: 2023-06-20 00:00:00
location:
description:
I found some code witch i’m trying to use:
sensor:
- platform: time_date
display_options:
- 'date'
template:
- sensor:
- name: Restafval
state: >
{% set t = now() %}
{% set midnight = today_at() %}
{% set event = state_attr('calendar.waste_collection_schedule', 'start_time') | as_datetime | as_local %}
{% set delta = event - midnight %}
{% set values = {0: 'Today', 1:'Tomorrow', 2:'Day After Tomorrow'} %}
{{ values.get(delta.days, 'In %s Days'%delta.days) }}
But i cant get it to work to filter on message names,
any one got some idee’s?