Lovelace custom card for Garbage Collection

February 21, 2026 ยท View on GitHub

hacs_badge

Lovelace custom card for Garbage Collection

End of Support

Garbage Collection custom integration, which this custom card has been originally written for, ended support at the begining of 2023. Features supporting HACS Waste Collection Schedule are partial compared to features of Garbage Collection and these can be covered and even surpassed by using the flexible Custom Button Card, input boolean and conditional card. Therefore I will end developing and supporting this card after February 2026.

Description

This Lovelace custom card displays garbage collection information provided by the Garbage Collection custom component you may find at https://github.com/bruxy70/Garbage-Collection.
It will draw your attention the day before the garbage collection by changing the icon color to your theme's active icon color by default.

Lovelace UI does not support platform attributes natively.
Implementation of handling attributes in Lovelace was inspired by entity-attributes-card.

Installation

The easiest way to install it is through HACS (Home Assistant Community Store), search for garbage and select Garbage Collection Card from Plugins.
If you are not using HACS, you may download garbage-collection-card.js and the translations directory and put them into homeassistant_config_dir/www/community/garbage-collection-card/ directory.
The card does not support configuration flow, therefore you'll have to add the resources via UI->Configuration ->Lovelace Dashboards->Resources then add the card manually editing the card configuration yaml on the dashboard at Add Card->Manual.

Lovelace UI configuration

Configuration parameters:

NameOptionalDefaultDescription
entityN-name of the sensor of garbage_collection platform.
dow_formatYlongFormat of the day of week. long and short are supported.
due_colorYtheme's icon active coloricon color on due date. Accepts both color names and RGB values.
due_1_colorYdue_coloricon color on the day before due date. Accepts both color names and RGB values.
due_txtYfalseFor today/tomorrow pick-ups use 'Due today' or 'Due tomorrow'. Has precendence over hide_date and hide_days.
icon_colorYtheme's icon coloricon color. Accepts both color names and RGB values.
icon_sizeY25pxsize of the icon.
icon_cell_paddingY35pxpadding applied to icon cell.
icon_cell_widthY60pxicon cell width.
hass_lang_priorityYfalsewhether HASS language has priority over browser language.
hide_beforeY-1hide entire card until X days before event. Default: do not hide card.
hide_dateYfalsehide date.
hide_daysYfalsehide number of days. Automatically set to true when collection is due today or tomorrow.
hide_dowYtruehide day of the week. Discarded when collection is due today or tomorrow.
hide_iconYfalsehide icon.
hide_on_clickYtruehide the card upon click when due date is today or tomorrow.
hide_on_todayYfalsehide the card when due date is today, e.g. collection is early in the morning.
hide_titleYfalsehide title.
title_sizeY17pxfont size for the sensor's friendly name.
details_sizeY14pxfont size for date and number of days.
sourceYGarbage-Collectionsource of garbage collection data.

source for garbage collection data supports fully Garbage-Collection. When garbage-collection sensors are used with verbose_state=True, hide_date and hide_days will be discarded, displayed text will be taken from the sensor's verbose_format.

Since Garbage-Collection custom integration has ended its support, a limited support for hacs_waste_collection_schedule has been added. Such sensor should have its state set to {{ value.daysTo }} and details_format set to generic. If the sensor doesn't limit the type of garbage, the first one with the nearest due date will be displayed. See examples below.

Garbage collection card supports some languages and displays the date information based on your locale setting by default. You may override this to use the language set in HASS for displaying its frontend.

When garbage collection is today or tomorrow, clicking on the card you can acknowledge that the garbage was prepared or collected and the card will be hidden until the day after due day or if hide_before is used, until X days before next due day.

Please add the card to the resources in configuration.yaml:

resources:
  //When using HACS installation method
  - {type: module, url: '/hacsfiles/garbage-collection-card/garbage-collection-card.js'}
  //When using manual install method
  - {type: module, url: '/local/garbage-collection-card.js'}

EXamples

Please find below an example of ui-lovelace.yaml for a sensor with data coming from Garbage-Collection custom integration (entity should be the sensor of garbage_collection platform you defined):

    cards:
      - type: custom:garbage-collection-card
        entity: sensor.selective_waste
        icon_size: 35px
        icon_color: green
        hide_date: true
      - type: custom:garbage-collection-card
        entity: sensor.waste
        hide_before: 4
        icon_color: '#0561ba'

Basic card:
Garbage Collection card example

Different icon sizes and colors:
Different icon sizes

Example of card for a sensor configured with hacs_waste_collection_schedule custom integration:

    cards:
      - type: custom:garbage-collection-card
        source: 'hacs_waste_collection_schedule'
        entity: sensor.next_collection

Supported sensor configuration:

platform: waste_collection_schedule
name: next_collection
details_format: 'generic'
value_template: '{{ value.daysTo }}'
### leadtime just limits the number of items to handle
leadtime: 10

Thanks

Thanks to all the people who have contributed!

contributors