How To Setup Garbage Collection Reminder

by Danny
0 comment

READING TIME: 10 MINUTES

In this guide, I’ll show you how to setup a garbage, trash, or recycling reminder in Home Assistant. To do this, we are installing a HACS integration called Garbage Collection. Once this is installed, you’ll be able to receive notifications on garbage day as well as see when the next collection day is schedule in a Lovelace card on your dashboard.

There are several ways to do this, but I’ve found this to be the easiest to setup and most flexible. It doesn’t rely on calendar, so you basically just set the trash pickup days, which device should receive the notifications, and you are good to go. It’s extremely flexible. For example, you can choose to receive weekly, biweekly, or monthly alerts. You can tell it to remind you the day after a national holiday

This guide assumes you already have HACS installed. If not, follow this Youtube video. It can be setup in just a few minutes.

For reference: My trash days are Tuesday and Thursdays. My recycling day is also Thursday.

Let’s get started!


Download Garbage-Collection Integration from HACS

The first thing you’ll need to do is download the “Garbage Collection” custom component via the Home Assistant Community Store (HACS). This is a custom component that loads all the necessary files.

Click the HACS sidebar icon > Integrations. In the bottom right corner, choose Explore & Add Repositories. Then, simply search for Garbage Collection.

Click Install This Repository in HACS in the bottom right corner. Click Install on the next popup window.

Normally, you’d need to reboot Home Assistant for the integration to show up and start working. But, before we reboot, I’m going to have you install the Garbage Collection Lovelace card while you are already in HACS.


Install “Garbage Collection Card” in Home Assistant via HACS

Click the Hacs sidebar > Frontend. Then click Explore & Add Repositories in the bottom right corner just like before.

Search for “garbage”. Click it to download and install.


Reboot Home Assistant

Now that both items are downloaded, reboot Home Assistant from Configuration > Server Controls > Check Configuration > Restart.


Configure Garbage Collection Schedule

To set up the schedule and reminder, we first need to install the integration. Whenever we downloaded the custom components from HACS, we basically added all the files necessary to complete the setup, but now we need to actually install it.

Configuration > Integrations > Add Integration > search for Garbage Collection.

A new window will pop up. These options are unique for everyone depending on your trash company, but I’ll show you a screenshot of how I set mine up.

Give it a name. This is optional, but I did check the box for “Verbose State” because it looks a little cleaner to me.

Verbose Option checked:

Verbose Option unchecked:

Other than that, everything else can be left default. Click Submit once complete.

In the next popup window, setup the days of the week and click Submit.

Next, a 3rd window will pop up. Set the First and Last collection month (defaults to January and December). Set your country so that the integration knows which date national holidays fall on, and then add 1 day (if your trash guys come the day after a holiday). Make sure to check the box for “Move to next day if holiday in week”.

This will prevent your card from showing you Home Assistant garage collection reminders on Christmas Day even if they won’t come until the next day. This is optional, but feel free to configure this based on your needs.

Then, just assign it to an area if you’d like. I’m just going to assign to my garage even those my trash bins are located on the side of my house.

IMPORTANT: If you are setting up two different services (for example Trash and Recycling), you can’t do both at the same time. You will have to install the integration again from Configuration > Integrations > search for Garbage.

When you view them under Configuration > Integrations, you should see both like this:


Add Recycling Schedule

Like I said in the red box above, if you’d also like to configure a recycling service as well, then you’ll do that by following the same steps above. Just give it a different name like “Recycling” instead of “Garbage” and set the schedule.

Configuration > Integrations > search for Garbage.


Add Trash & Recycling Card to a Lovelace Dashboard

Basic Collection Card

The most basic card you can add for this is an Entities card. Just add a new card > Entities and search for the sensors.

Entity should be the name of the sensor you defined. To look them up, go to Configuration > Entities > search for “garbage”.

Here’s what the basic card looks like:


Advanced Collection Card

If you’d like to display a more advanced card with icons for both services, then would click Add Card > Manual.

The advanced card would look like this:

Then, paste in this YAML:

cards:
  - entity: sensor.garbage
    icon_color: brown
    icon_size: 35px
    type: custom:garbage-collection-card
  - entity: sensor.recycle
    icon_color: green
    icon_size: 35px
    type: custom:garbage-collection-card
type: vertical-stack

Change Collection Icons

If you didn’t change the icons when you originally configured the integration, you can do that from within the card as well. I’m going to change the icons for my recycling service to mdi:recycle. You are welcome to seach for anything specific from the MaterialDesignIcons.com website.

Just go back to Configuration > Integrations > click either Garbage or Recycle > Configure.

HA Collection Card Usage

I’ve pulled this info directly from the Garage Collection Card github page. I recommend checking it out after setting everything up just to see if there’s an additional parameters you’d like to setup.

When the collection date is today or tomorrow, you can click on the card to acknowledge that the trash or recycling has been taken out. It will then be hidden until the day AFTER the due day has passed. Or, if you specified the hide_before, it will hide the card until X days before the next due day.


Home Assistant Garbage Collection Notification Reminders & Automation

In addition to see these directly in Lovelace, you want to receive a push notification to your phone reminding you to “Take out the trash!” You could easily build this yourself using the HA “Automations” tab, but an easier way would be to use a Community-created Blueprint.

Garage Reminder Blueprint (not working currently)

NOTE: I found this blueprint but it seems to only be semi-working as of 8/23/21. It will send the reminder when you manually run it, but won’t show you which sensor in the push notification message. I’ll update this section if/when I get it working after I get a response from the Blueprint creator.

In the meantime, you can use the Automation below.


Garage Reminder Automation

I referenced Tom_I’s solution and changed it up a bit.

My trash days are on Monday and Thursday, and recycling is only on Thursday. This makes creating an automation that displays the correct message a little difficult.

Basically, you add a bit of code to your config file. Then, you add a few binary sensors for trash_today, trash_tomorrow, recycle_today, recycle_tomorrow. Then, you reference those new sensors in your automation.

The code below definitely works and triggers on Monday (as noted in the configuration.yaml collection_days), but I think I would need to create 2 new sensors for Thursday since you can’t do “mon,thu”.

I still have to test this out a bit more for my unique scenario but here’s what I have.

Configuration.yaml

File Editor > Configuration.yaml.

Paste this in. Change up the collection days and frequency if needed.

garbage_collection:
  sensors:
  - name: "Garbage" # Each week on Monday and Thursday
    frequency: "weekly"
    collection_days: "mon"
  - name: "Recycling" # Each week on Thursday
    frequency: "weekly"
    collection_days: "mon"

Add new Binary Sensors

If you already have a sensors: section defined in your configuration.yaml, then add this code exactly as if below. If you don’t, just add a sensors: as a new line to top of the below code.

  - platform: template
    sensors:
      recycling_today:
        entity_id: sensor.recycling
        friendly_name: "Recycling Today"
        value_template: "{{ is_state('sensor.recycling', '0') }}"

  - platform: template
    sensors:
      recycling_tomorrow:
        entity_id: sensor.recycling
        friendly_name: "Recycling Tomorrow"
        value_template: "{{ is_state('sensor.recycling', '1') }}"

  - platform: template
    sensors:
      garbage_today:
        entity_id: sensor.trash
        friendly_name: "Garbage Today"
        value_template: "{{ is_state('sensor.trash', '0') }}"

  - platform: template
    sensors:
      garbage_tomorrow:
        entity_id: sensor.trash
        friendly_name: "Garbage Tomorrow"
        value_template: "{{ is_state('sensor.trash', '1') }}"

Then reboot Home Assistant from Configuration > Server Controls > Restart. Make sure to check your config for errors first.

Create Garbage Reminder Automation

Create a new automation under Configuration > Automations. Switch to the YAML editor and paste this in:

alias: Garbage Reminder Test
description: ''
trigger:
  - platform: time
    at: "18:00:00'
condition:
  - condition: time
    weekday:
      - sun
    after: '18:00:00'
    before: '18:00:00'
action:
  - service: notify.mobile_app_pixel_5_danny
    data_template:
      title: Garbage & Recycling Reminder
      message: |
        {% if is_state('binary_sensor.recycling_tomorrow', 'on') %}
          Reminder to take out the trash AND recycling.
        {% else %}
          Reminder to take out the trash.
        {% endif %}
mode: single
initial_state: true

Wrapping Up

If you have a better solution for being reminded the day before trash needs to go out, let me know in the comments below so I can update my guide.


My Favorite Home Assistant Devices

Below are some of the Home Assistant-compatible devices I personally use in my home. I highly recommend each of them.

The full list of all Home Assistant compatible & recommended devices I use can be found on my Equipment List page.

0 comment

You may also like

Leave a Comment