Bin Sensors in Home Assistant - Shell & Template
As part of my Home Assistant dashboard I want to include useful information which is not directly related to smart devices in my home.
With the uptick in recycling in recent years, we now have 4 different bins that need to go out on the street on different weeks for collection. On the off-chance I’m one of the first in the street to be putting one or more of them out, I wanted a quick way to work out which should be going out.
The bins go out on a fixed day of the week, with a routine like this:
Bin Type | Schedule |
---|---|
Black/Green - Non Recyclable Waste | Thursday (Fortnightly) |
Burgundy - Food and garden | Thursday (Fortnightly) |
Blue (paper and card) | Thursday (4 Weekly) |
Light Grey - Glass, cans and plastics | Thursday (4 Weekly) |
My first version of this dashboard element looks like this:
This shows:
- The bin(s) that are due to go out next
- The day & date of the next collection
- The number of days until the next collection
This requires some custom sensors to hold the next collection date and type, and there are (at least) two approaches that can be taken to achieve this:
- Using the shell command integration and a pair of python scripts
- Using a couple of template sensors