I posted this on Facebook and there was some interest in sharing the YAML and templates I used to get this going. Formatted Text on Facebook is painful, so I decided to post it up over here.
I was taking out the garbage this morning when I noticed my printed waste collection schedule ended in December. While printing a new one I noticed that the municipality’s website was powered by something called “recollect”. Turns out a whole bunch of Canadian cities are using this service and there’s already an integration. With the recollect integration, a couple of helpers, and a couple button cards I have managed to add this week’s waste schedule to my dashboard on Monday and Tuesday…
Now to start making my dashboards prettier!
There’s actually 6 buttons in there, that are hidden based on what week it is. The whole horizontal stack is hidden if it’s not the day before or day of garbage collection day.
- type: horizontal-stack
cards:
- type: conditional
conditions:
- condition: state
entity: binary_sensor.waste_recycle
state: 'on'
card:
type: custom:button-card
entity: binary_sensor.waste_recycle
color-type: icon
color: rgb(36, 91, 255)
show_name: false
tap_action:
action: none
- type: conditional
conditions:
- condition: state
entity: binary_sensor.waste_garbage
state: 'on'
card:
type: custom:button-card
entity: binary_sensor.waste_garbage
color-type: icon
color: rgb(102,102,102)
show_name: false
tap_action:
action: none
- type: conditional
conditions:
- condition: state
entity: binary_sensor.waste_organics
state: 'on'
card:
type: custom:button-card
entity: binary_sensor.waste_organics
color-type: icon
color: rgb(51,102,0)
show_name: false
tap_action:
action: none
- type: conditional
conditions:
- condition: state
entity: binary_sensor.waste_yardwaste
state: 'on'
card:
type: custom:button-card
entity: binary_sensor.waste_yardwaste
color-type: icon
color: rgb(153,102,0)
show_name: false
tap_action:
action: none
- type: conditional
conditions:
- condition: state
entity: binary_sensor.waste_exemptionday
state: 'on'
card:
type: custom:button-card
entity: binary_sensor.waste_exemptionday
color-type: icon
color: rgb(102,102,102)
show_name: false
tap_action:
action: none
- type: conditional
conditions:
- condition: state
entity: binary_sensor.waste_batteries
state: 'on'
card:
type: custom:button-card
entity: binary_sensor.waste_batteries
color-type: icon
color: rgb(255,153,51)
show_name: false
tap_action:
action: none
visibility:
- condition: state
entity: binary_sensor.is_garbage_day_coming
state: 'on'
I have 1 helper to determine if it’s garbage day, and 6 helpers to show the different types of collection days. For my city the values were “garbage”, “recycling”, “organics”, “yardwaste”, “garbage_exemption_day”, " battery_pickup_day", and “treepickup”. My family does not do live christmas trees so I didn’t bother with treepickup.
The template for each of the helpers basically looks like this:
{{ 'recycling' in state_attr('sensor.recollect_waste_current_pickup', 'pickup_types') }}
Obviously I’m not the first person to setup Recollect, but I hope I can inspire someone else!