Waste Collection Schedule in HomeAssistant
Overview
Sometimes, I totally forget to take out the garbage bins. And around here, the rule is simple: if your bins aren’t on the sidewalk, the garbage truck just cruises by like a VIP limo ignoring peasants.
When we first moved in, I forgot to take out the recycling bags (Gelber Sack) three times in a row. This resulted in a majestic mountain of 25 bags filled with plastic, empty cat food cans, and my dignity.
To avoid turning my house into a landfill, I’m using the Waste Collection Schedule via HACS. Since I like keeping my data and my trash collection local, I downloaded the ICS file from the city’s waste management service and share it through a filebrowser container so Home Assistant can grab it.
Now, I have three trusty sensor
entities keeping me on track:
sensor.restabfall
sensor.gelber_sack
sensor.papier
configuration.yaml
1waste_collection_schedule:
2 sources:
3 - name: ics
4 args:
5 url: !secret waste_collection_ics_url
6 offset: 0
7 calendar_title: Waste Collection
sensors.yaml
1- platform: waste_collection_schedule
2 name: Restabfall
3 value_template: "{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %}"
4 types:
5 - Restabfall
6- platform: waste_collection_schedule
7 name: Gelber Sack
8 value_template: "{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %}"
9 types:
10 - Gelber Sack
11- platform: waste_collection_schedule
12 name: Papier
13 value_template: "{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %}"
14 types:
15 - Papier
Cards
Armed with the mystical powers of card-mod, the sorcery of mushroom-entity-card, and the sheer chaos of a well-placed grid, I conjured up the following magical creation:
1square: false
2columns: 3
3type: grid
4cards:
5 - type: custom:mushroom-entity-card
6 entity: sensor.restabfall
7 tap_action:
8 action: none
9 hold_action:
10 action: none
11 double_tap_action:
12 action: none
13 icon_type: none
14 fill_container: false
15 layout: vertical
16 card_mod:
17 style: |
18 ha-card {
19 background-color:
20 {% if is_state('sensor.restabfall', 'in 2 days') %}
21 #FFE4B5
22 {% elif is_state('sensor.restabfall', 'Tomorrow') %}
23 #FA8072
24 {% else %}
25 #FFFFFF
26 {% endif %}
27 }
28 - type: custom:mushroom-entity-card
29 entity: sensor.gelber_sack
30 tap_action:
31 action: none
32 icon_type: none
33 layout: vertical
34 hold_action:
35 action: none
36 double_tap_action:
37 action: none
38 card_mod:
39 style: |
40 ha-card {
41 background-color:
42 {% if is_state('sensor.gelber_sack', 'in 2 days') %}
43 #FFE4B5
44 {% elif is_state('sensor.gelber_sack', 'Tomorrow') %}
45 #FA8072
46 {% else %}
47 #FFFFFF
48 {% endif %}
49 }
50 - type: custom:mushroom-entity-card
51 entity: sensor.papier
52 tap_action:
53 action: none
54 icon_type: none
55 layout: vertical
56 hold_action:
57 action: none
58 double_tap_action:
59 action: none
60 card_mod:
61 style: |
62 ha-card {
63 background-color:
64 {% if is_state('sensor.papier', 'in 2 days') %}
65 #FFE4B5
66 {% elif is_state('sensor.papier', 'Tomorrow') %}
67 #FA8072
68 {% else %}
69 #FFFFFF
70 {% endif %}
71 }
72grid_options:
73 columns: 12
74 rows: auto
Posts in this series
- Waste Collection Schedule in HomeAssistant
- How Rearranging a Kid's Room Broke My Zigbee Network (and How I Fixed It)