dylandoamaral / uptime-card

Minimalistic uptime card for Home Assistant Lovelace UI
266 stars 11 forks source link

History not shown for non-binary sensors #129

Closed tYn0 closed 2 years ago

tYn0 commented 2 years ago

Yesterday I created non-binary sensors for checking the state of services running on my media server. Sensor state is either "Online" or "Offline", card displays the state correctly but bars are set to "None":

type: custom:uptime-card
entity: sensor.service_monitor_deluge
ok: Online
ko: Offline
icon_adaptive_color: true
hours_to_show: 24
bar:
  round: 4
  amount: 24

image image

dylandoamaral commented 2 years ago

I see nothing wrong here, you still have the issue ?

tYn0 commented 2 years ago

Not sure if I am misunderstanding how the card should work but shouldnt all bars in the screenshot be green? Either way I played around with it and put a few cards in entities card to get a nicer display: image When I refresh the page it sometimes "works" - here Deluge sensor isn't working even though it should: image

type: entities
entities:
  - type: custom:uptime-card
    entity: sensor.service_monitor_plex
    title_template: Plex
    ok: Online
    ko: Offline
    hours_to_show: 24
    icon_adaptive_color: true
    show:
      footer: false
      status: false
    bar:
      amount: 24
      round: 6
  - type: custom:uptime-card
    entity: sensor.service_monitor_deluge
    title_template: Deluge
    ok: Online
    ko: Offline
    hours_to_show: 24
    icon_adaptive_color: true
    show:
      footer: false
      status: false
    bar:
      amount: 24
      round: 6
  - type: custom:uptime-card
    entity: sensor.service_monitor_nzbget
    title_template: NZBGet
    ok: Online
    ko: Offline
    hours_to_show: 24
    icon_adaptive_color: true
    show:
      footer: false
      status: false
    bar:
      amount: 24
      round: 6
  - type: custom:uptime-card
    entity: sensor.service_monitor_sonarr
    title_template: Sonarr
    ok: Online
    ko: Offline
    hours_to_show: 24
    icon_adaptive_color: true
    show:
      footer: false
      status: false
    bar:
      amount: 24
      round: 6
  - type: custom:uptime-card
    entity: sensor.service_monitor_radarr
    title_template: Radarr
    ok: Online
    ko: Offline
    hours_to_show: 24
    icon_adaptive_color: true
    show:
      footer: false
      status: false
    bar:
      amount: 24
      round: 6
  - type: custom:uptime-card
    entity: sensor.service_monitor_prowlarr
    title_template: Prowlarr
    ok: Online
    ko: Offline
    hours_to_show: 24
    icon_adaptive_color: true
    show:
      footer: false
      status: false
    bar:
      amount: 24
      round: 6

I also noticed some errors regarding the uptime-card in console: image

tYn0 commented 2 years ago

Also, this weird behaviour... The card being in entities card has no effect, I tested it on independent custom:uptime-card and it was the same

https://user-images.githubusercontent.com/10382681/173198993-7aaa3ebe-b3c6-4f37-8bc2-d7eb2fdda937.mp4

dylandoamaral commented 2 years ago

Yup there is clearly an issue I will try to investigate. It works on my home assistant instance, this is actually weird !

However I don't see the issue with the video (expect that sometimes there is data and sometimes no).

dylandoamaral commented 2 years ago

https://github.com/dylandoamaral/uptime-card/pull/131 should resolves the console error ag least. I will try to make a release, tell me if things are fixed or not after the release.

tYn0 commented 2 years ago

The issue is fixed! Thanks for the great card and quick support