Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Trying to set max for custom:bar-card with a sensor value

$
0
0

@fribse wrote:

I’m trying to implement the corona sensor.
I want to set the max for the bar cards to the biggest number instead of a static number.
But I can’t seem to use a template to set the max for the graph to work:

cards:
  - card:
      max: '{{ states(''sensor.worldwide_coronavirus_confirmed'') | int }}'
      min: 0
      padding: 2px
      title_position: inside
      type: 'custom:bar-card'
      width: 100%
    filter:
      include:
        - entity_id: '*worldwide_coronavirus*'
    type: 'custom:auto-entities'
  - card:
      max: '{{ states(''sensor.denmark_coronavirus_confirmed'') | int }}'
      min: 0
      padding: 2px
      title_position: inside
      type: 'custom:bar-card'
      width: 100%
    filter:
      include:
        - entity_id: '*denmark_coronavirus*'
    type: 'custom:auto-entities'
type: vertical-stack

This gave this result:

image

:frowning:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles