/garbage-collection-card

Custom Lovelace card for Garbage Collection custom component

MIT LicenseMIT

Buy me a coffee

Lovelace custom card for Garbage Collection

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 red 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.

Lovelace UI configuration

Configuration parameters:

Name Optional Default Description
entity N - name of the sensor of garbage_collection platform.
due_color Y red icon color on due date. Accepts both color names and RGB values.
due_1_color Y due_color icon color on the day before due date. Accepts both color names and RGB values.
due_txt Y false For today/tomorrow pick-ups use 'Due today' or 'Due tomorrow'.
icon_color Y black icon color. Accepts both color names and RGB values.
icon_size Y 25px size of the icon.
hide_date Y false hide date.
hide_days Y false hide number of days.
hide_before Y false hide entire card until x days before event.
title_size Y 17px font size for the sensor's friendly name.
details_size Y 14px font size for date and number of days.

Garbage collection cards supports some languages and displays the date information based on your locale setting.

When garbage-collection sensors are used with verbose_state=True, hide_date and hide_days will be discarded, taking the information from the sensor's verbose_format.

When garbage collection is planned for today or tomorrow, clicking on the card you can acknowledge that the garbage was prepared or collected and the card will become hidden.

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

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

Please find below an example of ui-lovelace.yaml (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