Home

Awesome

🗑️ TrashCard

GitHub Release License hacs_badge

Project Maintenance GitHub Activity downloads Build

<a href="https://www.buymeacoffee.com/idaho" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

<img width="510" alt="new-overview" src="https://github.com/idaho/hassio-trash-card/assets/664101/8adeaf6a-f236-4972-805d-e173c3aa554b">

TrashCard - is a custom Home Assistant card that shows you the next upcoming or current trash removal appointment. For this purpose a calendar entity is used, in which you have entered all appointments.

See screenshots for what you can do

Features

Pre-Requirements

TrashCard requires Mushroom for Home Assistant to be installed. Please follow the installation instructions of Mushroom. Once you have installed Mushroom you can continue install TrashCard using HACS (preferred) or manually.

TrashCard requires a calendar to get its data from. This calendar must be known by Home Assistant as an entity. Check Home Assistant calendar integrations for more information on how to add it.

Installation

HACS

TrashCard is available in HACS (Home Assistant Community Store).

  1. Install HACS if you don't have it already
  2. Open HACS in Home Assistant
  3. Go to "Frontend" section
  4. Click button with "+" icon
  5. Search for "TrashCard"

Manual

  1. Download trashcard.js file from the latest release.
  2. Put trashcard.js file into your config/www folder.
  3. Add reference to trashcard.js in Dashboard. There's two way to do that:
    • Using UI: SettingsDashboardsMore Options iconResourcesAdd Resource → Set Url as /local/trashcard.js → Set Resource type as JavaScript Module. Note: If you do not see the Resources menu, you will need to enable Advanced Mode in your User Profile

    • Using YAML: Add following code to lovelace section.

      resources:
        - url: /local/trashcard.js
          type: module
      

Usage

Create events in your calendar

In order for the Trash card to display informations, they need to be existing in a calendar. Here's some rules to follow when creating the events in your calendar:

  1. It must be entire day events (only form of events supported at the moment)
  2. You must use the same event name for the same method of collection. You'll map them later. Right now, the card support up to 5 different type of collections
  3. You can use repeating events, that's totally fine.

Configuration

The TrashCard cards can be configured using Dashboard UI editor.

Add a new card

  1. In Dashboard UI, click 3 dots in top right corner.
  2. Click Edit Dashboard.
  3. Click Plus button to add a new card.
  4. Find the Custom: TrashCard card in the list.

All the options are available in the lovelace editor but you can use yaml if you want.

NameTypeDefaultDescription
entitiesarray of stringsRequiredEntities
layoutstringOptionalLayout of the card. Vertical, horizontal and default layout are supported
fill_containerbooleanfalseFill container or not. Useful when card is in a grid, vertical or horizontal layout
filter_eventsbooleanfalseFilter fetched events by patterns (if at least one is defined) before selecting the one to display
full_sizebooleanfalseShow the card without the default card margins
drop_todayevents_fromtime10:00:00From what time to hide all-day event (Format hh:mm:ss)
use_summarybooleanfalseShows the event summary instead of matched label
hide_time_rangebooleanfalseOption to hide the time on events which aren't fill day events
event_groupingbooleantrueOnly display the next event per pattern, otherwise all events during the selected time will be displayed
next_daysnumber2How many times the card will look into the future to find the next event
day_styledefault or counterdefaultOption of how the date of an event should be displayed. default shows the date in date format and counter shows the number of days remaining until the event.
card_stylecard, chip or iconcardSwitch between the events style Standard card, Chip card or a new Icon predefined layout.
alignment_styleleft, center, right or spaceleftSwitch between alignments on Chip card card_style
color_modebackground or iconbackgroundSelect whether the color settings should be applied to the background or to the symbol
refresh_rateinteger60Check for changes in the calendar every x minutes, by default we will check every 60 minutes. Values can be set from 5 to 1440.
debugbooleanfalseOption to enable debug mode to help fixing bugs ;) .
icon_sizeinteger40Size of the icons in px if you choose card_style as icon .
with_labelbooleantrueOption to decide if you want to see the label in the card or the chip style.
patternarray of PatternRequiredPattern to detect the kind of trash and how to display it.

Pattern

NameTypeDefaultDescription
typeorganic, paper, recycle, waste, others, customRequiredLabel which should be shown
labelstringRequiredLabel which should be shown
iconstringRequiredIcon which should be displayed
colorstringRequiredBackground color of the card which should be used
patternstringRequiredPattern used to detected to display the apply this trash type. (Is tested against the calendar entry title)
picturestringOptionalpicture url to a image to show instead of the icon

Other type trash configuration

NameTypeDefaultDescription
iconstringRequiredIcon which should be displayed
colorstringRequiredBackground color of the card which should be used

Example YAML configuration

type: custom:trash-card
entities:
  - calendar.mags_abfuhrtermine
layout: vertical
event_grouping: true
drop_todayevents_from: '10:00:00'
next_days: 300
day_style: counter
card_style: card
color_mode: background
items_per_row: 4
refresh_rate: 60
with_label: true
filter_events: false
use_summary: false
hide_time_range: false
pattern:
  - label: Organic
    icon: mdi:flower
    pattern: braun
    color: light-green
    type: organic
  - label: Paper
    icon: mdi:newspaper-variant-multiple-outline
    color: indigo
    pattern: blau
    type: paper
  - label: Recycling
    pattern: gelb
    icon: mdi:recycle-variant
    color: amber
    type: recycle
  - pattern: grau
    icon: mdi:trash-can
    label: Waste
    color: dark-grey
    type: waste
  - icon: mdi:dump-truck
    color: purple
    type: others
  - label: Electric
    icon: mdi:electron-framework
    color: pink
    type: custom
    pattern: elektro

Screenshots

Layout icons

<img width="482" alt="layout-icons" src="https://github.com/idaho/hassio-trash-card/assets/664101/b1509694-7ece-49a4-8f84-6298731e315f">

Layout chips

<img width="1043" alt="layout-chips" src="https://github.com/idaho/hassio-trash-card/assets/664101/c420d073-c65d-41cc-8d47-c296c1c03fd4">

Layout cards

layout-cards

Use picture instead of icons

<img width="1032" alt="with-image" src="https://github.com/idaho/hassio-trash-card/assets/664101/212537e0-65d3-4c2c-a25c-9431d7ff04b9">

Thanks

Thanks go to the team at Mushroom for creating many beautiful cards.

<!-- Badges --> <!-- References -->