Automate Reminders For Your Bin Collection with Home Assistant

Get automated notifications reminding you to put the bins out so you never miss another collection again!

Automate Reminders For Your Bin Collection with Home Assistant

Intro

At the start of the pandemic, our bin collection was reduced to once every three weeks and, unfortunately, it's never been altered back. So, we've found ourselves often getting confused and forgetting when they were due - sometimes relying just on your neighbours isn't enough.

And yet again, Home Assistant saves the day! I created a notification to remind us the night before (ours get emptied really early in the morning) the recycling and the bins are due to go out.

We both get notifications to our phones, as well as text to speech announcement on the speakers, just to be on the safe side - we really can't risk missing a week since it's now every 3 weeks!

Scroll right the the bottom for the YAML code 👇🏼

How It's Done

Requirements

  • HACS installed in Home Assistant
  • (Optional) A smart phone configured with the Home Assistant App
  • (Optional) A speaker in Home Assistant for TTS announcements

Installing the Garbage Collection integration

Firstly we will install the Garbage Collection integration from HACS, this is a really cool integration that allows you to customise your bin collection schedule.

Head over to HACS, Integrations and add a new integration. Search for Garbage collection and hit install (it's the top one with the green icon):

Make sure to restart Home Assistant after installation by going to Settings, System and hit Restart in the top right hand corner.

Once restarted, head over to Settings, Devices and Services and hit the add integration button and search for Garbage Collection:

Then you are going to want to configure the integration to suit you, in my case the settings look like this:

Once finished, you will have a sensor that looks like this:

The cool thing is, this integration also gives you a calendar entity - this will be useful in the next step:

The Automation

We are going to now create the automation that will handle the notifications.

Head over to Settings, Automations and Scenes, create a new empty automation and give it a name:

Then in the Triggers section, select Calendar from the drop-down and then select the Garbage Collection entity.

You'll want to select Event Start, and then offset the start time - this makes sure that the automation runs at an appropriate time of the day instead of at midnight. For example, I offset the time by 5 hours so that the automation will run at 7pm the night before the bins need to be out:

There is no condition required for this automation.

Finally under the action section we are going at a simple phone notification as well as a text-to-speech announcement on a speaker.

For the first action, select call service as the type, and then search for the notification service for your phone. Then enter a title and message:

Next, add a second action - this time choose the "Play Media" service. Select your speaker from the entity drop-down:

Then click on pick media, select Text-To-Speech and then enter your message:

Hit save on the automation, and you are done!

The automation will now run the night before the bins are due to go out, nice!

The Code

Here is the final automation code for those of you who prefer YAML:

alias: Notify - It's bin day!
description: ''
mode: single
trigger:
  - platform: calendar
    event: start
    offset: '-5:0:0'
    entity_id: calendar.garbage_collection
condition: []
action:
  - service: notify.mobile_app_galaxy_s8
    data:
      message: It's bin day tomorrow!
      title: Just to let you know..
  - service: media_player.play_media
    target:
      entity_id: media_player.kitchen_speaker
    data:
      media_content_id: >-
        media-source://tts/google_translate?message=The+bins+need+to+be+out%2C+go+go+go%21
      media_content_type: provider
    metadata:
      title: The bins need to be out, go go go!
      thumbnail: https://brands.home-assistant.io/_/google_translate/logo.png
      media_class: app
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://tts
        - media_content_type: provider
          media_content_id: >-
            media-source://tts/google_translate?message=The+bins+need+to+be+out%2C+go+go+go%21