amaximus / garbage-collection-card

Custom Lovelace card for Garbage Collection custom component
MIT License
128 stars 24 forks source link

Different icon color standard/due date not working (1.5.4 / 108.9) #33

Closed Liese2007 closed 4 years ago

Liese2007 commented 4 years ago

Hi, with my code

type: 'custom:garbage-collection-card'
entity: sensor.stadtreinigung_hamburg_xxxx_gelbe_wertstofftonne_sack
icon_size: 35px
icon_color: yellow
hide_date: true

The Card works fine in Manual Card of Lovelace. But all icons are red. Screenshot-Garbage-Card

I installed via HACS. Resources are set in Lovelace Dashboard (with Resources Tab shown). I hope I have not missed a setting...

Regards Jörg

Amendment: These are the attributes shown in Developer Tools:

Last update: '2020-04-28T15:04:44.914633'
unit_of_measurement: ''
friendly_name: Biotonne
icon: 'mdi:trash-can-outline'
device_class: timestamp
amaximus commented 4 years ago

I wonder what provides the sensor's state value and attributes as the Garbage Collection platform (https://github.com/bruxy70/Garbage-Collection/) doesn't set device_class and unit_of_measurment.

My test sensor with card config set to similar values shows up in yellow:

(ha_venv3_7) pi@raspberrypi:~/homeassistant_conf $tail -5  ui-lovelace.yaml
      - type: custom:garbage-collection-card
        entity: sensor.test_garbage_weekly
        icon_color: yellow
        icon_size: 35px
        hide_date: true
(ha_venv3_7) pi@raspberrypi:~/homeassistant_conf $

screenshot-2020 04 28-20_44_03

amaximus commented 4 years ago

Moreover please check the state value of sensor..stadtreinigung_hamburg_xxxx_gelbe_wertstofftonne_sack. According to the dates it should be 2, while the colors indicate 1 or 0.

Liese2007 commented 4 years ago

The state of the sensors is a timestamp like: 2020-05-06T00:00:00 for Biotonne

amaximus commented 4 years ago

The custom card was written to process state and attributes from Garbage Collection platform ((https://github.com/bruxy70/Garbage-Collection/), so it expects attributes like next_date and days [till the collection]. Your sensor doesn't seem to have these.

amaximus commented 4 years ago

Any update on this issue? Is the sensor provided by Garbage Collection custom platform?

Liese2007 commented 4 years ago

Sorry, my mistake. You are right, that my waste disposal provider has different interface not in line with your component.

Thanks for your effort. Greetz