Expected Reading Time: 9 minutes

Imagine never having to think about when the garbage collection is coming again. Does that sound good? Then this guide is just the thing for you. With the Home Assistant and the Waste Collection Schedule plugin, you can automate your waste collection and set up notifications and a clear dashboard. So you're always up to date.

For detailed instructions and an explanation of all configuration options, I recommend the YouTube video linked below. In this video, every single setting is explained in detail so that you receive comprehensive instructions for the exact setup. You can find any code from the video in this article so that you can use it directly without having to type it in.

Why it's good to have the garbage appointments in Home Assistant

Integrating your garbage appointments into Home Assistant offers numerous advantages and opens up a wide range of possibilities:

  1. Automatic notificationsYou'll never miss a collection date again. This saves you unpleasant odors and extra work.
  2. Clear dashboardYou always have an overview of all waste collection dates and can adjust your budget planning accordingly.
  3. Complex automationsUse the integration to make your smart home even smarter. Examples:
    • Switch on the outside lights to remind you to put the garbage out.
    • Set up voice announcements via your smart speakers.
  4. Combination with other automationsConnect the garbage appointments with other automations for more convenience and security:
    • Lock the front door automatically when you have taken out the garbage.
    • Activate an alarm mode after you have disposed of the waste.

This allows you to benefit from greater convenience while increasing the security and efficiency of your home.

Features of the Waste Collection Schedule

The Waste Collection Schedule plugin offers many useful features to make your waste collection more efficient and smarter:

  • Flexible data sourcesSupports local calendar files (.ics) and online services for garbage collection appointments.
  • Customizable waste typesConfigure different types of waste such as residual waste, organic waste and paper individually.
  • Seamless integrationConnects easily with Home Assistant so you can set up notifications and reminders.
  • Clear dashboardCreate a dashboard with sensors and Lovelace cards that displays all important information at a glance.

With these features, your waste management always remains well organized and easy to handle.

What is Home Assistant?

Home Assistant is an open source platform for home automation that aims to connect and centrally control all devices in the home. It is designed to provide a unified user interface and simple, flexible control for a variety of smart home devices from different ecosystems. Here are some points in favor of Home Assistant:

  1. CompatibilityHome Assistant supports thousands of devices and services from various manufacturers, including lighting, air conditioning, heating, cameras, weather sensors, voice assistants and more.
  2. Local controlUnlike many commercial smart home platforms that rely on cloud services, Home Assistant runs locally on your network. This means increased privacy and reliability, as your smart home devices work even without an active internet connection.
  3. Automation and scenesOne of the main features of Home Assistant is the ability to create complex automations and scenarios. For example, you can have lights switch on automatically when it gets dark or turn on the heating when the temperature falls below a certain level.
  4. Simple user interfaceHome Assistant offers a user-friendly interface that makes it easy to monitor and control devices. This interface is fully customizable.
  5. Integration with voice assistantsHome Assistant can be integrated with voice assistants such as Amazon Alexa or Google Assistant to enable voice-controlled control of your smart home devices.
  6. Open source and community-drivenSince Home Assistant is open source, it is supported by an active community that is constantly developing new integrations and improving existing ones.
  7. Data protection and securityAs a locally running platform, Home Assistant has the advantage that the data remains within its own network. This protects privacy and increases security compared to cloud-based solutions.

In summary, Home Assistant is a powerful and flexible solution for those who want to design their own smart home and control their devices centrally, regardless of the manufacturer or ecosystem.

Installation of HACS and integration of Waste Collection Schedule in Home Assistant

Step 1: Installing HACS in Home Assistant

Home Assistant Community Store (HACS) is a custom add-on for Home Assistant that provides access to a variety of custom integrations and plugins developed by the community. How to install HACS:

  1. Check requirements: Make sure that your Home Assistant is ideally up to date.
  2. Download Execute script: Open a terminal for the Docker container version or the core version.
    • Docker: Dial into the container with: docker exec -it homeassistant bash or (similar)
    • Core: Switch to the user who is running Home Assistant
    • Execute the following command for both variants:
      wget -O - https://get.hacs.xyz | bash -
  3. Restarting the Home Assistant: After the files have been copied, restart Home Assistant.
  4. Integrate HACS into Home AssistantGo to "Configuration" > "Integrations" > "Add" in the Home Assistant interface and search for HACS. Add it and enter your GitHub token if prompted.

For the supervised version, please refer to the Documentation of HACS itself to read about the installation.

Step 2: Add Waste Collection Schedule Integration via configuration.yaml

Once HACS is installed, you can simply add Waste Collection Schedule:

  • Editing the configuration.yaml:
    • Open the configuration.yaml file in your Home Assistant directory.
  • Look at the Website of the plugin to see if there is a provider for your region: https://github.com/mampfes/hacs_waste_collection_schedule?tab=readme-ov-file#supported-service-providers
  • Adding the waste collection configuration:
    • The configuration is individual. If there is a service provider, use it! Otherwise you can refer to a public ics file or connect a local file.
    • Add the following section to your configuration.yaml file:

Example Duisburg via Abfallplus

waste_collection_schedule:
  sources:
    - name: app_abfallplus_en
      args:
        app_id: APP ID
        city: CITY/COMMUNITY
        street: STREET
        hnr: HOUSE NUMBER
        state: FEDERAL STATE
        county: COUNTY
        district: BEZIRK

Example external public calendar

waste_collection_schedule:
  sources:
    - name: ics
      args:
        url: "https://example.com/your_waste_collection_schedule.ics"

Replace the URL https://example.com/your_waste_collection_schedule.ics with the URL of your .ics file containing the garbage collection dates.

Example local file

waste_collection_schedule:
  sources:
    - name: ics
      args:
        file: "/config/www/duisburg.ics"
  • Adaptation of waste types:
    • Under the section customize you can define different types of waste. For example:
      • type: Waste for residual waste
      • type: Organic for organic waste
      • type: Paper for paper
    • Use aliasto specify user-defined names for the waste types.
waste_collection_schedule:
  sources:
    customize:
      - type: Household waste
        alias: Household waste
        icon: mdi:trash-can
      - type: Waste paper
        alias: Waste paper
        icon: mdi:trash-can
      - type: Recycling bin
        alias: Plastic waste
        icon: mdi:trash-can
  • Save and restart:
    • Save the changes in the configuration.yaml File.
    • Restart Home Assistant so that the configuration is applied.
  • Review and adjustment:
    • After the restart, the new sensors for waste collection should be available in Home Assistant.
    • Check the configuration and adjust it further if necessary to ensure that all waste types are displayed correctly.

Complete example configuration

waste_collection_schedule:
  sources:
    - name: app_abfallplus_en
      args:
        app_id: de.idcontor.abfallwbd
        city: Duisburg
        hnr: 31
        street: Buchholzstr.
        district: Wanheimerort
      calendar_title: Waste calendar Duisburg
  fetch_time: "08:00"
  day_switch_time: "12:00"

Conclusion

With these steps, you have successfully installed HACS in your Home Assistant and added the Waste Collection Schedule integration. This powerful combination opens up a world of additional features and customizations that have been and are being developed by the Home Assistant community. More blog posts and videos on useful integrations to follow. If you don't want to miss out, subscribe to my YouTube channel!

Sensors

So that we can now also send notifications and know exactly when the next waste date is coming up, we also have to enter the configuration.yaml create some sensors. It is important that under types the name that is also supplied by your calendar. Otherwise the whole thing will not work. For the following automation, the sensor WasteNext necessary in any case.

- platform: waste_collection_schedule
  source_index: 0
  name: garbage_collection_date
  details_format: upcoming
  value_template: 'in {{value.daysTo}} days'
  date_template: 'on {{value.date.strftime("%a")}}, {{value.date.strftime("%d.%m.%Y")}}'
  add_days_to: true

- platform: waste_collection_schedule
  name: AbfallHausmuell
  details_format: "upcoming"
  value_template: '{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %}'
  types:
    - Household waste

- platform: waste_collection_schedule
  name: AbfallAltpapier
  details_format: "upcoming"
  value_template: '{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %}'
  types:
    - Waste paper

- platform: waste_collection_schedule
  name: WastePlastics
  details_format: "upcoming"
  value_template: '{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %}'
  types:
    - Recycling garbage can

- platform: waste_collection_schedule
  name: AbfallHausmuellNext
  details_format: "upcoming"
  value_template: 'am {{value.date.strftime("%d.%m.%Y")}}'
  types:
    - Household waste

- platform: waste_collection_schedule
  name: AbfallAltpapierNext
  details_format: "upcoming"
  value_template: 'am {{value.date.strftime("%d.%m.%Y")}}'
  types:
    - Recovered paper

- platform: waste_collection_schedule
  name: WastePlasticsNext
  details_format: "upcoming"
  value_template: 'am {{value.date.strftime("%d.%m.%Y")}}'
  types:
    - Recycling garbage can

- platform: waste_collection_schedule
  name: AbfallNaechster
  details_format: "upcoming"
  value_template: ' {{ value.daysTo }} '

Automation for notifications

alias: Monitor - Waste collection
description: ""
trigger:
  - platform: time
    at: "17:00:00"
condition:
  - condition: numeric_state
    entity_id: sensor.abfallnaechster
    below: 2
action:
  - variables:
      icon: >
        {% set trash = states.sensor.abfallnaechster.attributes.values() | first
        %} {% if 'Household waste' == trash %}
          mdi:trash-can
        {% elif 'Waste paper' == trash %}
          mdi-package-variant
        {% else %}
          mdi-recycle
        {% endif %}
      icon-color: >
        {% set trash = states.sensor.abfallnaechster.attributes.values() | first
        %} {% if 'Household waste' == trash %}
          black
        {% elif 'Waste paper' == trash %}
          blue
        {% else %}
          yellow
        {% endif %}
    enabled: false
  - service: notify.smartphones
    data:
      title: garbage collection
      message: >-
        {{ states.sensor.abfallnaechster.attributes.values() | first }}
        put out!
      data:
        notification_icon: >
          {% set trash = states.sensor.abfallnaechster.attributes.values() |
          first %} {% if 'Household waste' == trash %}
            mdi:trash-can
          {% elif 'Waste paper' == trash %}
            mdi:package-variant
          {% else %}
            mdi:recycle
          {% endif %}
        color: >
          {% set trash = states.sensor.abfallnaechster.attributes.values() |
          first %} {% if 'Household waste' == trash %}
            black
          {% elif 'Waste paper' == trash %}
            blue
          {% else %}
            yellow
          {% endif %}
mode: single

This home assistant automation reminds you to put out the trash by sending a notification to your smartphone. Here is a detailed explanation of the automation:

Alias and description

The name of the automation is "Monitor - waste collection". There is no description for this automation.

Trigger

The automation is triggered daily at 17:00.

Condition

The automation is only executed if the sensor sensor.wastewater (which represents the next collection date) has a value below 2. This means that the collection date is either today or tomorrow.

Actions

Set variables

Variables are set for the icon and the icon color:

  • A corresponding icon is set depending on the next waste type:
    • Household waste: trash-can
    • Waste paper: package-variant
    • Other waste: recycle
  • An icon color is set according to the next waste type:
    • Household waste: black
    • Waste paper: blue
    • Other waste: yellow

Send notification

The notification service notify.smartphones is used to send a notification. The data for the notification includes:

  • The title of the notification is "Waste collection".
  • The message contains the next waste type and the request to highlight it.
  • The icon is set according to the next waste type.
  • The color of the icon is set according to the next waste type.

Mode

Automation is activated in single which means that it will not be restarted if it is already running.

Summary

This automation checks daily at 17:00 whether the next collection date is today or tomorrow. If this is the case, it sets variables for the icon and the icon color based on the next waste type. It then sends a notification to your smartphone containing the next waste type and a request to put it out.

YouTube video implementation

Conclusion

In conclusion, you can see that the integration of garbage appointments in Home Assistant brings considerable advantages. Never again will you have to forget the garbage collection date or wonder when which type of garbage will be collected. Thanks to automatic notifications, you always stay informed and can act in time to avoid unpleasant odors or overflowing garbage cans.

The clear dashboard also allows you to customize your household planning and make your smart home environment even smarter. With the Waste Collection Schedule integration and Home Assistant, you have a powerful solution at hand to organize your waste management efficiently and at the same time increase comfort and security in your home.

The display of the products was implemented with the affiliate-toolkit plugin.

0 Comments

Leave a Reply

Avatar placeholder

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_US