logo smart home family kruse

Kruse Smart Home

Easy living in our smart home & Garden

Home Assistant dashboard card with garbage pickup dates

Home Assistant garbage pickup notification

14 December 2022

Jan-Willem

1. Introduction

Every Friday a specific type of our garbage is picked up, which always leads to the question which waste container should be put alongside the street. The answer can easily be provided via Home Assistant by making use of the integration AfvalWijzer to create a Home Assistant dashboard card similar to the one below showing the garbage pickup dates.

2. Requirements

The following is required to create a garbage scheduled collection date card on the Home Assistant dashboard:

  • Your municipality must support providing waste collection schedules via the AfvalWijzer website. Enter your zipcode and home number to test if AfvalWijzer is supported.

  • The Home Assistant integration AfvalWijzer;
  • The Home Assistant integration lovelace template-entity-row;
  • The Home Assistant File editor add-on to edit the Home Assistant configuration files;
  • Images for the different types of waste to be used on the card
    Download link available later in this article.
  • Access to the folders of your Home Assistant (for uploading the images)
    I use the Home Assistant Samba share add-on to access the Home Assistant folders on my Raspberry Pi 4 via a Windows computer.

For the remainder of this article the starting point is that the requirements are met and that the integrations and add-on have been installed.

3. Configuration

The configuration is split into providing your address for the Afvalwijzer and copying the required waste type images to your Home Assistant folders.

3.1 Configure the address for AfvalWijzer

Execute the following steps to configure the Afvalwijzer integration to fetch the correct scheduled garbage collection dates from the MijnAfvalWijzer website:

  1. Open the sensor.yaml file via the File editor and add the following to the sensor configuration file:
  2. Update the postal code and street number to resemble your home.
  3. Save the file.

3.2 Copy waste type image files to your Home Assistant installation

The images shown in the card for each waste type are fetched from the Home Assistant www folder. In my case:

\config\www\images\afvalwijzer

The images can be downloaded from the AfvalWijzer website. or from posts in the Home Assistant community forum w.r.t. the Afvalwijzer integration. I collected the images from both sites and for your convenience they can be downloaded here for your own use.

 If you would like to use waste container images see Gemeente Geertruidenberg (but you need to extract them from the image).

Copy the images you want to use to the Home Assistant folder:

/local/images/afvalwijzer

4. Dashboard card setup (lovelace)

In first instance I created the card including the days till the garbage collection would occur as shown in the introduction, but later I decided to simplify the card as shown below.

The next 2 sections provide the required steps to make both cards.

4.1 Card showing also days till garbage collection

Execute the following steps:

  1. Go to the Home Assistant dashboard  and add a new manual card
  2. Open the code editor for this new card
  3. Copy/paste the following code
  4. Save the card and check it is working.

4.2 Minimalistic card

Execute the following steps:

  1. Go to the Home Assistant dashboard  and add a new manual card
  2. Open the code editor for this new card
  3. Copy/paste the following code
  4. Save the card and check it is working.

5. Additional info

5.1 Image folder and names

If you want to use another path for the images the following line needs to be updated accordingly in the YAML code of the card:

The image names should be the same as the waste type name used by the Afvalwijzer integration (indicated by type). For using fixed names see the examples in the Home Assistant community forum.

6. Sources for ideas

I started with the lovelace card code used by Martijn Hoogenbosch as it seem to be less complex then the others available on the Home Assistant community forum. Other sources for ideas:

If you are living in another country than The Netherlands the following sources might help you:

Article by <a href="https://smarthome.familykruse.eu/author/iamjwk/" target="_self">Jan-Willem</a>

Article by Jan-Willem

Position

Writen by the website owner

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *