Giter Site home page Giter Site logo

idaho / hassio-trash-card Goto Github PK

View Code? Open in Web Editor NEW
79.0 4.0 12.0 2.37 MB

TrashCard - indicates what type of trash will be picked up next based on your calendar entries 🗑️

License: Apache License 2.0

JavaScript 3.08% TypeScript 96.92%
card hacs home-assistant mushroom paper trash calendar frontend hassio lovelace

hassio-trash-card's Introduction

🗑️ TrashCard

GitHub Release License hacs_badge

Project Maintenance GitHub Activity downloads Build

Buy Me A Coffee

new-overview

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

  • Extra color, icon and text for residual, organic, paper waste and recycling
  • Color and icon for all other appointments
  • Filter out unexpected items

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.

Name Type Default Description
entities array of strings Required Entities
layout string Optional Layout of the card. Vertical, horizontal and default layout are supported
fill_container boolean false Fill container or not. Useful when card is in a grid, vertical or horizontal layout
filter_events boolean false Filter fetched events by patterns (if at least one is defined) before selecting the one to display
full_size boolean false Show the card without the default card margins
drop_todayevents_from time 10:00:00 From what time to hide all-day event (Format hh:mm:ss)
use_summary boolean false Shows the event summary instead of matched label
hide_time_range boolean false Option to hide the time on events which aren't fill day events
event_grouping boolean true Only display the next event per pattern, otherwise all events during the selected time will be displayed
next_days number 2 How many times the card will look into the future to find the next event
day_style default or counter default Option 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_style card, chip or icon card Switch between the events style Standard card, Chip card or a new Icon predefined layout.
alignment_style left, center, right or space left Switch between alignments on Chip card card_style
color_mode background or icon background Select whether the color settings should be applied to the background or to the symbol
refresh_rate integer 60 Check for changes in the calendar every x minutes, by default we will check every 60 minutes. Values can be set from 5 to 1440.
debug boolean false Option to enable debug mode to help fixing bugs ;) .
icon_size integer 40 Size of the icons in px if you choose card_style as icon .
with_label boolean true Option to decide if you want to see the label in the card or the chip style.
pattern array of Pattern Required Pattern to detect the kind of trash and how to display it.

Pattern

Name Type Default Description
type organic, paper, recycle, waste, others, custom Required Label which should be shown
label string Required Label which should be shown
icon string Required Icon which should be displayed
color string Required Background color of the card which should be used
pattern string Required Pattern used to detected to display the apply this trash type. (Is tested against the calendar entry title)
picture string Optional picture url to a image to show instead of the icon

Other type trash configuration

Name Type Default Description
icon string Required Icon which should be displayed
color string Required Background 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

layout-icons

Layout chips

layout-chips

Layout cards

layout-cards

Use picture instead of icons

with-image

Thanks

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

hassio-trash-card's People

Contributors

bertah avatar bl4d3s avatar clawfire avatar dependabot[bot] avatar idaho avatar intexsk avatar kacperaniolek avatar kylehakala avatar maxyvon avatar mdeweerd avatar misa1515 avatar samjakbal avatar semantic-release-bot avatar tandonnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hassio-trash-card's Issues

French translation

Hello and sorry for this.
I didn't found the right way to send you this so I decided to open an issue.
Here is the translation in french
fr.json

Nice job and have a good day ;)

please help set this card up (only got "invalid date")

Hi everybody,

I subscribe to my local trash pickup services *.ics , so I doubt this has to do with me messing up the ical format...

I installed the card, reloaded Home Assistant, then added the calendar entity to the card.

As you can see here, it will actually detect something (in this case, only organic, even though paper will be picked up tomorrow as well), but it has some issue with the date.

grafik

The calendar is displayed in the Home Assistant calendar without issues, which lets me assume that the date is formatted correctly..?

grafik

I tried to minimize the card as much as possible, removing the patterns:

grafik

That does not make a difference.

Can you please tell me what I need to do in order to fix this? Thank you in advance :)

Trash Card only show 1 Entry

Hi,

ive an Problem, ive an "AbfallPlus" ics in my homeassistant. My Calendar works fine, but the trash card not. It only show "Trash" ("Restmüll"). Ive integrated another calendar plugin, so that all of them are displayed.

I have also "thrown away" my config once and adapted your example config.

I also set the days to 30 / 60 and then to 100 days as a test.

Comparison of the Trash plugin with a calendar plugin:
image

here my config:

type: custom:trash-card
entity: calendar.abfallkalender
layout: vertical
settings:
  others:
    color: purple
    icon: mdi:trash-can
  organic:
    label: Bio
    icon: mdi:flower
    color: green
    pattern: Bio
  paper:
    label: Papier
    icon: mdi:newspaper-variant-multiple
    color: blue
    pattern: Blau
  recycle:
    label: Plaste
    icon: mdi:recycle-variant
    color: amber
    pattern: Gelb
  waste:
    label: Restmüll
    icon: mdi:trash-can-outline
    color: deep-orange
    pattern: Rest
next_days: 100

& here is an screenshot of my "Abfallkalender"
image

[Feature]: Trash due date entities for reminders

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

No

Describe the solution you'd like

I would like to have entities available for all five trash types which carry the number of days until an event happens (= the trash is picked up). These entity values should be updated once per day. Users could then create automations based on the values of the entities, when they become relevant.

What could then be possible:
Idea 1: create automatic reminder if trash is picked up today
Idea 2: create weekly reminder to see 'trash schedule's
Idea 3: living in a Multi-Person household, person A could mark a 'trash event' complete, if not done, person B could get notified

Automations should be user created (as details may vary), but the entities should be provided by this addon.

Describe alternatives you've considered

Complicated - calculate due date of the events myself and store in helpers. But since this addon already does 98% of what I am looking for, I'd appreciate an enhancement.

Additional context

No response

Normalise name

The name of the trash card should be normalised over the whole project. Currently we have trash-card, TrashCard, Trashcard. We should pick one

[Bug]: Card does not show up on tablet but all other devices

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

The card does not show up at all on my tablet (Amazon Fire HD10 plus).
The same dashboard and user used on my phone or computer works well and card is visible.
I don't get any error messages or something in the log files and the configuration seems to be correct as it works on all other devices.

image see picture this part is missing on the tablet screen.

Expected Behavior

Card to be visible in the dashboard on all platform and devices

Steps To Reproduce

No response

Context

YAML state

Environment

- Browser: Fully Kiosk
- HA Version: 2024.03
- TrashCard: 2.0.0

Debug data

No response

Anything else?

No response

Weekday in "Custom Date"

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

I would like to see only the weekday instad of dd.mm.yyy, because is too long

Describe the solution you'd like

I think that the custom date format have to accept also ddd for the weekday

Describe alternatives you've considered

No response

Additional context

No response

Custom element doesn't exist

Hi
I have repurposed an old iPad Air on iOS 12 and I'm getting a 'Custom element doesn't exist: trash-card' message. Using the app and Safari.
I have an iPad Pro 12.9 (1st gen) on iOS 16 also an iPad Air (4th gen) on iOS 17 that it works fine on.
I've only started using the cards today so I can't say if it worked previously.
IMG20231206192024

[Feature]: Hide Time

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Not at all. But it would be better, without that much infos.

Describe the solution you'd like

On my card, it shows the time between. That takes a lot of space.

It would be great to disable the time and just show the day

Describe alternatives you've considered

No response

Additional context

No response

[Feature]: show all entries for the same type

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

If I set the "Days in the future" to for example 7 days and there are 2 pcs of "waste" collection on two different days only the first one on the closest days is displayed. For example today is 1st of Feb. There are waste collection on 3rd and 6th of Feb. Only the one on 3rd is displayed.

Expected Behavior

Display both (all) collections entries during the period selected in "Days on the future" .

Steps To Reproduce

No response

Context

YAML state

Environment

- Browser: any
- HA Version: core 2024.2.1
- TrashCard: 2.0.0-beta1

Anything else?

No response

[Feature]: Add "bulk reject"

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

One of the collection types is "bulk reject" (or "Encombrants" in French).
I think that this could be a specific waste type rather than "other".

Describe the solution you'd like

Add another waste type that would have the short name "bulk".

Describe alternatives you've considered

The alternative is to have it covered by "other", but other could refer to other cases for instance for "dangerous waste".

Additional context

No response

[Feature]: Change the color of the entity, the day before the event

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Currently my card is like this:
image

Describe the solution you'd like

be able to change the background color of the entity the day before the event to indicate that the garbage can is to be taken out.

Something like this :

image

and i confirm that a click on the entity to indicate that the garbage can has been taken out and change the background color .... would be great.

ps :
a short date, type dd/mm/YYYY ( to be displayed on one line only) could be nice

Thanks for the work already done!
:)

Describe alternatives you've considered

--

Additional context

--

[Bug]: All days event doesn't work anymore

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

If the next event in the calendar is an all-day event the card is empty.
image

Expected Behavior

The card should display the next trash can day has it did in version 1.2.1.
I've tested with version 1.2.1 and it worked fine.
I tried with 1.2.1 because there seems to have been an update to add the possibility of having an event that doesn't last all day. on 1.2.2.
image

Steps To Reproduce

I installed the latest version of the card. After trying to config the card I realised that it only worked on my calendars that didn't have an all-day event next.

Environment

- Browser: Chrome
- HA Version: 2023.12.3
- TrashCard: 1.4.1

[Bug]: Wont show upcoming Garbage Events after update

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

After I updated from ver. 1.1.0 to ver. 1.4.3 , it no longer shows my upcoming Garbage Pickups

image

Expected Behavior

After I restore from backup to version 1.1.0, it works as expected

image

Steps To Reproduce

No response

Context

type: vertical-stack
cards:

  • type: custom:mushroom-title-card
    title: Upcoming Garbage Pickup
    subtitle: ''
  • drop_todayevents_from: '23:00:00'
    next_days: 1
    day_style: default
    type: custom:trash-card
    settings:
    others:
    icon: ''
    color: orange
    paper:
    label: Cardboard
    color: brown
    pattern: Cardboard
    icon: mdi:newspaper-variant-outline
    waste:
    label: Trash
    color: blue-grey
    icon: mdi:trash-can
    pattern: Trash
    recycle:
    label: Plastic/Cans
    icon: mdi:recycle
    color: indigo
    pattern: Plastic/Cans
    organic:
    label: Yard Waste
    icon: mdi:leaf
    color: amber
    pattern: Yard Waste
    fill_container: false
    use_summary: false
    filter_events: false
    entity: calendar.garbage
  • drop_todayevents_from: '10:00:00'
    next_days: 2
    day_style: default
    type: custom:trash-card
    entity: calendar.yard_waste
    settings:
    others:
    icon: ''
    color: orange
    paper:
    label: Cardboard
    color: brown
    pattern: Cardboard
    icon: mdi:newspaper-variant-outline
    waste:
    pattern: Trash
    label: Trash
    color: blue-grey
    icon: mdi:trash-can
    recycle:
    label: Plastic/Cans
    icon: mdi:recycle
    color: indigo
    pattern: Plastic/Cans
    organic:
    label: Yard Waste
    icon: mdi:leaf
    color: amber
    pattern: Yard Waste
    fill_container: true

Environment

- Browser: Chrome/Edge
- HA Version: 2024.1.2
- TrashCard: 1.4.3

Anything else?

No response

[Feature]: Add a Title

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

no problems

Describe the solution you'd like

I also use the Trash Card to display other dates, such as holidays or birthdays. Therefore an optional title would be desirable. It would also be good if you could choose more than one calendar. Very good and nice work so far.

Thanks

Describe alternatives you've considered

No response

Additional context

No response

Card Scale

Having troubles getting the card to scale correctly.
Image below to show how it looks
image
image
image

[Feature]: Add second line to "chip"layout

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

additional value for chip-layout

Describe the solution you'd like

Currently the Chip-layout has only one label in a single line (eg. "Morgen" or "in 2 Tagen")
I would like to use the chip-layout with the additional label of the trash-type (eg. "Biomüll" or "Gelber Sack")

result would look like this:
(icon) Biomüll
______in 2 Tagen

Describe alternatives you've considered

No response

Additional context

No response

Wrong color?

Besides the sizing problem, I would also have expected another color from the configuration.

grafik

Configuration:

type: custom:trash-card
entity: calendar.ics
settings:
  others: {}
  recycle:
    label: Wertstoffsammlung
    pattern: (Wertstoffsammlung)
    icon: mdi:recycle-variant
    color: yellow
  waste:
    label: Restabfallsammlung
    pattern: (Restabfallsammlung)
    icon: mdi:trash-can-outline
    color: grey
  paper:
    pattern: (Papiersammlung)
    label: Papiersammlung
    icon: mdi:newspaper-variant-multiple
    color: blue
fill_container: false
layout: horizontal

Where is the yellow? I would have expected an all yellow button background?

[Documentation]: Explain what entries are expected in the agenda/how to map agenda entries.

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

It's not clear how the collection types are mapped with regards to the agenda.

I've searched for a forum entry but could not find one.

It's an issue to use the card if it's not sufficiently documented.

Describe the solution you'd like

Explain how a calender entry should be created and how it is mapped to the card.

Describe alternatives you've considered

No response

Additional context

No response

[Bug]: Days in the future issue

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

Hi,

I have installed this great card but for some reason the days in the future option doesn't work as intended.
I have set the days in the future to 1 but it shows a calendar event that is 2 days in the future. (See attached screenshot).

Yesterday it was Wednesday 27-3 and the garbage pick up event is on Saturday 30-3. But the card was already visible on the 27th while the days in the future is set to 1.

Any idea how to solve this?
Schermafbeelding 2024-03-28 om 12 14 43

Expected Behavior

Be hidden until 1 day before the pickup (calendar event)

Steps To Reproduce

No response

Context

YAML state

type: custom:trash-card
entities:
  - calendar.afvalbeheer_rd4
items_per_row: 1
refresh_rate: 60
with_label: true
filter_events: true
hide_time_range: false
full_size: false
use_summary: false
event_grouping: true
drop_todayevents_from: '10:00:00'
next_days: 1
pattern:
  - icon: mdi:delete-empty
    color: light-green
    type: organic
    label: Huisvuilophaling GFT
    pattern: GFT
  - icon: mdi:delete-empty
    color: light-green
    type: paper
    pattern: Papier
    label: Huisvuilophaling papier
  - icon: mdi:delete-empty
    color: light-green
    type: recycle
    label: ' Huisvuilophaling PMD'
    pattern: PMD
  - icon: mdi:delete-empty
    color: light-green
    type: waste
    label: Huisvuilophaling restafval
    pattern: Restafval
  - icon: mdi:dump-truck
    color: purple
    type: others


Environment

- Browser: Safari, Chrome and HA companion app on iOS and Android
- HA version: 
Core 2024.3.3
Supervisor 2024.03.1
Operating System 12.1
Frontend 20240307.0
- TrashCard: 2.1.0

Debug data

No response

Anything else?

No response

Can't get multple pickups a day to work.

Hey! First off, thanks for the card! I just have some problems with it, might be me just misunderstanding it ofc.

I use https://github.com/mampfes/hacs_waste_collection_schedule to create a schedule of when my garbage is picked up, and it creates separate whole day events for those pickups. So for example; on Monday I have a pickup for waste and organics. But instead of displaying both, the card only displays the waste. Any idea why?

I have double check to see what the actual names the waste collection scheduler is assigning them.

(Matavfall is essentially organics and resavfall is essentially waste)
image

image

Add config for date range

At the moment the date range for fetching is limited by 2/3 days.

Please add and config option for settings a custom rage. It took me couple of hours to find out why my card was empty the whole time 😁

[Feature] Option to trigger a service

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

No

Describe the solution you'd like

Provide an Option in the settings to trigger a service
In my case i have a rgb lamp that shows me the state of any trash related topics (green, blue, yellow, white)

Describe alternatives you've considered

No response

Additional context

No response

[Translation]: polish

Type of request

Add a new language

For which language you want to make a request

pl

Content of the translations

pl.json

[Feature]: Adjust font colour based on background colour

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

The font on the cards is always black text - when this is layered on a black background the font is not readable.

Describe the solution you'd like

Auto adjust the font colour based on the colour set in the pattern ... eg our wast bins are black and so I wanted a black background to the pattern but we can read the font - either date on a standard card or days to go on an icon card

Describe alternatives you've considered

No response

Additional context

No response

[Feature]: Hungarian translation

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

No

Describe the solution you'd like

Hungarian translation

Describe alternatives you've considered

no

Additional context

hu.json

[Bug]: Not picking the event from calendar (2 patterns in 1 event, nb of days)

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

My agenda contains 1 event with 2 patterns for week 1 and then 2 events with 2 patterns for week 2
week 1:
image
week 2:
image

The card only shows the first event and the second part of it:
image

changing use summary to true you see that it picked the correct event but didn't split it:
image

Events are not configure at day level as mentioned in the doc as this is not working (#143)

Expected Behavior

I was expecting to see these 2 cards with the same nb of days
image

And the 2 others with another remaining time
image

Steps To Reproduce

This is my config:

type: custom:trash-card
drop_todayevents_from: '09:00:00'
next_days: 15
day_style: counter
entity: calendar.me_alaingoossens_be
layout: horizontal
settings:
organic:
label: Vert
icon: mdi:flower
color: green
pattern: (vert)
paper:
label: Papier
icon: mdi:newspaper-variant-multiple
color: yellow
pattern: (jaune)
recycle:
label: PMD
icon: mdi:recycle-variant
color: blue
pattern: (bleu)
waste:
label: Poubelle
icon: mdi:trash-can-outline
color: black
pattern: (noir)
others: {}
fill_container: false
full_size: true
filter_events: true
use_summary: false

Context

YAML state

Environment

- Browser: Chrome
- HA Version:2023.12.3
- TrashCard:1.4.1

Anything else?

No response

Apply filtering to events before selecting event to display

Hey,

I have tried Trash Card to work with my Google Calendar that contains only full-day events for waste schedule. Those are named after fractions, e.g. "Zmieszane" (mixed/general), "Plastiki" (plastic) etc. At first I had an impression that the card was intended to display multiple events, then I thought that maybe filters are applied to look for given items only.

For example, let's say my calendar has:
Mixed 18th December
Recycleable 19th December

If I configured the card for both mixed and recycleable, mixed would show. If I configured the card for recycleable (with Recycleable filter), only recycleable would show. So apparently the card basically shows the first found (the soonest) event and the styles it accordng to settings. Would it be possible to first filter the events, then select the first out of filtered ones, then apply the styling and display?

Example (full month view for reference):
image

Code:

      - type: horizontal-stack
        cards:
          - type: custom:trash-card
            entity: calendar.harmonogram_smieci
            settings:
              waste:
                label: Zmieszane
                icon: mdi:trash-can-outline
                pattern: Zmieszane
                color: grey
            fill_container: false
            next_days: 31
            full_size: false
            layout: horizontal
            view_layout:
              position: main
          - type: custom:trash-card
            entity: calendar.harmonogram_smieci
            settings:
              recycle:
                icon: mdi:recycle
                pattern: Plastik
                label: Plastiki i metale
                color: amber
            fill_container: false
            next_days: 31
            full_size: false
            layout: horizontal
            view_layout:
              position: main
      - type: custom:trash-card
        entity: calendar.harmonogram_smieci
        settings:
          others:
            icon: mdi:help-box
          paper:
            icon: mdi:note-multiple-outline
            label: Papier
            pattern: Papier
            color: blue
          waste:
            label: Zmieszane
            icon: mdi:trash-can-outline
            pattern: Zmieszane
            color: grey
          recycle:
            icon: mdi:recycle
            pattern: Plastik
            label: Plastiki i metale
            color: amber
          organic:
            label: Szkło
            icon: mdi:glass-fragile
            pattern: Szkło
            color: green
        fill_container: false
        next_days: 31
        full_size: false
        view_layout:
          position: main
        layout: horizontal
      - initial_view: dayGridMonth
        type: calendar
        entities:
          - calendar.harmonogram_smieci

I would expect the first card to show:

  • on the left: "Zmieszane 18 grudnia"
  • on the right: "Plastiki i metale 19 grudnia" - but it shows "Zmieszane" with default styling, as that card has no filter for "Zmieszane"

Do you think this is something doable or you don't see your work heading that direction?

card only showing "others" card

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

default calander from my wast pickup service. looks like that the card search for specific message from the calender. and trash card it thinking that the other is active.

image

Expected Behavior

expected to set the correct type

Steps To Reproduce

No response

Context

event_grouping: true
drop_todayevents_from: '10:00:00'
next_days: 8
pattern:

  • icon: mdi:flower
    color: lime
    type: organic
  • icon: mdi:newspaper
    color: blue
    type: paper
  • icon: mdi:recycle-variant
    color: amber
    type: recycle
    label: Package waste pickup
  • icon: mdi:trash-can-outline
    color: grey
    type: waste
  • icon: mdi:dump-truck
    color: purple
    type: others
    day_style: counter
    card_style: chip
    color_mode: background
    items_per_row: 1
    refresh_rate: 60
    with_label: true
    type: custom:trash-card
    entities:
  • calendar.twente_milieu
    layout: vertical
    filter_events: false
    use_summary: false
    hide_time_range: false

Environment

- Browser:
- HA Version: 2024.3.0
- TrashCard: 2.0.0

Debug data

No response

Anything else?

No response

[Translation]: Hungarian

Type of request

Updates / fixes to a existing language

For which language you want to make a request

hu

Content of the translations

There is a typo in Hungarian language. Here is the corrected translation:
"organic": "Komposztálható"

[Feature]: Icon only mode

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

The cards are taking a lot of space while it could be simplified to only an icon and a number.

Describe the solution you'd like

Have an option to display icon only combine with the counter would give a small card like this but with the trash icons.
image

Describe alternatives you've considered

No response

Additional context

No response

[Feature]: Implement horizontal and vertical layout

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Current layout options appear to have no effect when specified. Multiple events within the look-ahead period appear as rows (like a vertical stack).

Describe the solution you'd like

Horizontal layout should appear like a horizontal stack card events in columns) and vertical layout like a vertical stack card (events in rows).

Describe alternatives you've considered

Even better if all events on the next “event day” appear in a single row, spaced like a horizontal stack. Events within the look-ahead duration show on additional rows, like a vertical stack card (one row per day).

Additional context

The current layout options appear to have no effect when specified.

Translation: Danish

Type of request

Add a new language

For which language you want to make a request

da

Content of the translations

Hi,

For the danish translation, please use below file.

da.json

Best regards
Kurt G. Nielsen

[Feature]: Italian language support

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Missing italian language 18n.

Describe the solution you'd like

I'd like the labels in italian language.

Describe alternatives you've considered

No response

Additional context

Here my (very trivial) translation

{ "editor": { "form": { "color_picker": { "values": { "default": "Colore di default" } }, "layout_picker": { "values": { "default": "Layout di default", "vertical": "Layout verticale", "horizontal": "Layout orizzontala" } }, "day_style": { "values": { "default": "Data", "counter": "giorni a" } } }, "card": { "generic": { "icon_color": "Colore icona", "layout": "Layout", "fill_container": "Riempi il container", "next_days": "Giorni nel futuro", "filter_events": "Filtra eventi con i pattern", "drop_todayevents_from": "Da quale orario nascondere gli eventi di Tutto il giorno", "full_size": "Card senza margini", "use_summary": "Usa l'oggetto dell'evento al posto dell'etichetta", "day_style": "Mostra la data degli eventi come" }, "trash": { "organic": { "label": "Etichetta Organico", "color": "Colore Organico", "icon": "Icona Organico", "pattern": "Pattern identificazione Organico" }, "paper": { "label": "Etichetta Carta", "color": "Colore Carta", "icon": "Icona Carta", "pattern": "Pattern identificazione Carta" }, "recycle": { "label": "Etichetta Plastica", "color": "Colore Plastica", "icon": "Icona Plastica", "pattern": "Pattern identificazione Plastica" }, "waste": { "label": "Etichetta Indifferenziato", "color": "Colore Indifferenziato", "icon": "Icona Indifferenziato", "pattern": "Pattern identificazione Indifferenziato" }, "others": { "color": "Colore Altro", "icon": "Icona Altro" } } } }, "card": { "not_found": "Entità non trovata", "trash": { "today": "Oggi", "tomorrow": "Domani", "day": "<DAY>", "today_from_till": "Oggi\nda <START> a <END>", "tomorrow_from_till": "Domani\ntra <START> e <END>", "day_from_till": "<DAY>\ntra <START> e <END>", "daysleft": "entro <DAYS> giorni", "daysleft_more": "entro <DAYS> giorni", "daysleft_from_till": "entro <DAYS> giorni\ntra <START> e <END>", "daysleft_more_from_till": "entro <DAYS> giorni\ntra <START> e <END>" } } }

[Feature]: 2 Events on one day

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

No

Describe the solution you'd like

In my region Paper and organic is on the same day. Id Like to Display them both. At the Moment Just one Item ist displayed.

Describe alternatives you've considered

No response

Additional context

No response

[Feature]: Tap to dismiss

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Currently, tapping the card does nothing. I would suggest a feature that when you tap the card, it gets dismissed.
The idea being, that once I take the trash out, I don't need to see the card anymore as a reminder. A quick tap on the card could dismiss it so that it doesn't block the dashboard.

Describe the solution you'd like

Tap the active card to dismiss it and hide it from view.

Describe alternatives you've considered

No response

Additional context

No response

[Bug]: not showing multiple events

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

Only shows one entry

Expected Behavior

Show all future events

Steps To Reproduce

No response

Context

drop_todayevents_from: '10:00:00' next_days: 14 day_style: default type: custom:trash-card settings: others: {} organic: label: Biotonne icon: mdi:flower-tulip-outline color: brown pattern: Biotonne paper: label: Papiertonne icon: mdi:newspaper-variant-multiple-outline color: blue pattern: papiertonne recycle: label: Gelbe Tonne icon: mdi:recycle color: yellow pattern: Gelbe Tonne waste: label: Restabfall icon: far:trash-can color: grey pattern: Restabfall 4wö entity: calendar.muellabfuhr_2 filter_events: false fill_container: false

Environment

Core 2023.12.4
Supervisor 2023.12.1
Operating System 11.2
Frontend 20231208.2
TrashCard 1.4.3

Anything else?

image

Feature: Allow chip style to be centered

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

I use many mushroom chip cards, which support it natively to center the chips horizontally.

Currently it looks like this:
image

Describe the solution you'd like

Ability to configure chips style to be horzontially centered.

This would be my goal:
image

I added only this class here:
image

Describe alternatives you've considered

Tried using card-mod, but seems to be not being applied at all (other mods work flawlessly, card-mod element is only applied at the lower levels per item)

Additional context

The source code already defines an align-center class on the .chip-container class but it is never applied/configured to be used.

[Bug]: Half-hour timezone offset prevents events from showing

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

No events show in the Card, because of negative time zone offset with a half-hour portion.

Expected Behavior

Events should be shown for all timezones.

Steps To Reproduce

With my correct timezone (-2.5), no events show.
If I change my timezone to a whole-number multiple of hours, events show correctly.

Context

No response

Environment

- Browser: Chrome
- HA Version:2024.3.1
- TrashCard: 2.1.0

Debug data

Debug information won't copy from the card.
However, "timezone" is given as "-02:-30".

Anything else?

Bug seems to be in the formatting of the minutes in the return statement of getTimeZoneOffset() in src/utils/getTimeZoneOffset.ts

customize date

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

no

Describe the solution you'd like

I can only choose the date of the event or the days counted. The date is formatted to "DAY, DDMMMYYYY", but I want it in a shorter form, i.e.: DD/MM/YYYY or DD/MM.
Thanks!

Describe alternatives you've considered

No response

Additional context

No response

[Help wanted] Looking for you: Languages, README etc

Hello everybody,

i'm currently working on version 2. But for some parts i would be happy if someone of you could support me.

Where i need you

  • Language maintenance

    • German
    • English
    • French
    • Polish
    • Italian
    • Hungarian
    • Slovakian
  • README / documentation

I would be really happy if someone of you could help.

"day_style: counter" calculation wrong

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

the calculation of th counter in "day_Style" seems wrong. also "next_days" seems not to work correctly!?

today: 23.02.2024
next event "Restmüll": 26.02.2024

TRY 1
settings:
day_style: counter
next_days: 3

result:
event doesn't show up?

TRY 2
settings:
day_style: counter
next_days: 4

result:
event shows up - label: "in 2 Tagen" > "in 2 days"

Expected Behavior

settings:
day_style: counter
next_days: 3

result:
event shows up - label: "in 3 Tagen"
because 23.02 + 3 days = 26.02

Steps To Reproduce

No response

Context

YAML state

drop_todayevents_from: '10:00:00'
next_days: 4
settings:
  others:
    color: purple
    icon: mdi:trash-can
  organic:
    label: Biomüll
    icon: mdi:flower
    color: green
    pattern: Bio
  paper:
    label: Altpapier
    icon: mdi:newspaper-variant-multiple
    color: blue
    pattern: Altpapier
  recycle:
    label: Gelber Sack
    icon: mdi:recycle-variant
    color: yellow
    pattern: Gelbe Säcke
  waste:
    label: Restmüll
    icon: mdi:trash-can-outline
    color: grey
    pattern: Rest
day_style: counter
type: custom:trash-card
entity: calendar.muellabfuhr
filter_events: true
fill_container: true
full_size: false
use_summary: false

Environment

- Browser:
- HA Version:
- TrashCard:

Anything else?

No response

Integration to Mushroom Strategy

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

No

Describe the solution you'd like

Hi,
just wondering if it is or would be be possible to integrate your add-on into Mushroom Strategy card.
Thx

Describe alternatives you've considered

No response

Additional context

No response

Guidance on how to get this to work

Hello all,

I’ve been wrecking my brain trying to figure out how to get Trashcard to work when added to my dashboard. I’ve tried following the instructions to the best of my understanding, but it just doesn’t seem to wanna show up. I'm not sure what else I need to do so I'm forced to ask for help here.

I’ve created a local calendar, as required, with two events in it, Trash and Recycling.

image

I also already have Mushroom installed. Within my dashboard configuration, I’ve configured Trashcard in this manner.

image

As instructed, the detection patterns are named exactly as the events in the calendar, but yet, no card shows up in the preview.

I’m not sure what I’m doing wrong. I tried looking around for more guidance but I guess most people just manage to get working without any issues, since I don't see anyone asking about how to set this up.

Please help. I really want to add this to my dashboard as it would be very useful for me. Thank you in advance.

[Bug]: Icon Color on Black Background

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

When choosing black for the waste color the icon is not truly visible.

image

Expected Behavior

Icon color to be different from the waster color (possibly white in this case?)

Steps To Reproduce

Select Black as the waste color

Context

YAML state

Environment

- Browser: Brave, iOS safari, Edge
- HA Version: 20231208.2
- TrashCard: 1.4.0

Anything else?

No response

[Feature]: <title> Time until and Date side by side

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Is it possible to display the time until the garbage cans and the date are emptied?

Describe the solution you'd like

I want the Date and the Time until side by side

Describe alternatives you've considered

No response

Additional context

No response

[Bug]: Icons and color not work

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

Icons and color are not shown in the dashboard
image

Expected Behavior

No response

Steps To Reproduce

No response

Context

YAML state

drop_todayevents_from: '10:00:00'
next_days: 14
settings:
  others: {}
  paper:
    label: Papier (Grüne Tonne)
    icon: mdi:newspaper-variant-multiple
    color: green
    pattern: (gruen)
  recycle:
    label: Plastik (Gelber Sack)
    icon: mdi:recycle-variant
    color: yellow
    pattern: (gelb)
  organic:
    label: Bioabfall (Braune Tonne)
    icon: mdi:flower
    color: brown
    pattern: (braun)
  waste:
    label: Restabfall (Graue Tonne)
    icon: mdi:trash-can-outline
    color: grey
    pattern: (grau)
type: custom:trash-card
entity: calendar.mullabfuhr
view_layout:
  position: main
fill_container: true
full_size: false
use_summary: false
layout: vertical

Environment

- Browser: Google Chrome (120)
- HA Version Core: 2024.1.1
- HA Version Supervisor: 2023.12.0
- HA Version Operating System: 11.3
- HA Version Frontend: 20240104.0
- TrashCard: 2.0.0-beta0

Anything else?

No response

[Bug]: Inline --trash-card-background breaks card-mod

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest TrashCard version.
  • I did a search to see if there is a similar issue or if a pull request is open.

Current Behavior

With the latest update I can no longer style the card with card-mod even using --trash-card-background.

Expected Behavior

I would expect to be able to change be able to edit the card background in a way consistent with an overwhelming majority of cards in HA.

Steps To Reproduce

    ha-card {
      background: rgba(96, 125, 139,0.3);             
                }

card-mod installed, injected this CSS

Context

YAML state

event_grouping: true
drop_todayevents_from: '10:00:00'
next_days: 4
pattern:
  - type: others
  - label: Recycle Pickup
    icon: mdi:recycle
    pattern: Recycle
    type: recycle
  - type: waste
items_per_row: 1
refresh_rate: 60
with_label: true
type: custom:trash-card
filter_events: true
entities:
  - calendar.disposal_management
card_mod:
  style: |
    ha-card {
      background: rgba(110, 255, 115,0.15);
      --card-primary-color: rgba(255, 255, 255,1);
      --card-primary-font-size: 18px;
      --card-secondary-color: rgba(255, 255, 255,0.7);
      --card-secondary-font-size: 12px;
      --card-secondary-line-height: 14px; 
                }
    mushroom-shape-icon {
       --shape-color-disabled: rgba(76, 175, 80,0.3);
       --icon-primary-color: rgba(255,255,255,.8);
                }

Environment

- Browser: Firefox, HA companion app on Pixel, (Chrome not rendering problem on windows)
- HA Version: 
   Core
    2024.3.0
   Supervisor
    2024.02.1
   Operating System
    12.0
- TrashCard:

Debug data

No response

Anything else?

Clicking off the inline CSS using the inspect feature in Firefox on desktop renders the card-mod designation. I also tried changing the card-mod injection to --trash-card-background and --ha-card-background but neither worked so it seems the issue is how these browsers handle and prioritize the inline style at the html element.

Update README.md

Readme must be updated

  • Description
  • Adding badges
  • mention lovelace mushroom cards which this is based on
  • Create image
  • Add documentation

[Feature]: Option to show "counter" day_style without "in" (shortened)

Requirements

  • I have updated Mushroom to the latest available version
  • I did a search to see if there is a similar issue or if a pull request is open.

Is your feature request related to a problem?

Hey hey, tinkering around with this card (absolutely brilliant by the way 😁), and my only downside so far is that I can't shorten the day counter further to just use something like "3 days" rather than "in 3 days". I've got a stack-in card that I have that shows all of my bin collections with a title and subtitle, and the last one just barely gets cut off (see image below).

image

Describe the solution you'd like

Any chance of getting an option to remove "in" from the counter text? (See example)

image

Describe alternatives you've considered

No response

Additional context

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.