dotKrad / hass-fpl

FPL Component for Home Assistant
MIT License
40 stars 20 forks source link

Card question #32

Closed zoopster closed 2 years ago

zoopster commented 2 years ago

First...thank you, thank you, thank you. I'd buy you a pony if I knew where to send it! This integration works perfectly...BUT.

You had posted the yaml for a card you use and for the life of me (and I really suck at HASS cards) I cannot get it to show correctly. I'm thinking its simply what entities I'm using.

So...the question is what entity goes where???

cards:
  - card:
      entities:
        - attribute: as_of_days          
          entity: sensor.fpl_*****
          entity_row: true
          max: '${ vars[0] }'
          name: Days
          positions:
            icon: 'off'
            indicator: 'off'
            minmax: inside
            title: inside
            value: inside
          severity:
            - color: Green
              from: 0
              to: '${ vars[0] * 0.5 }'
            - color: Yellow
              from: '${ vars[0] * 0.5 + 1}'
              to: '${ vars[0] * 0.80 }'
            - color: Red
              from: '${ vars[0] * 0.80 + 1}'
              to: '${ vars[0] }'
          style: 'ha-card{border-radius: 0;}'
          type: 'custom:bar-card'
      title: FPL
      type: entities
    entities:
      - sensor.fpl_*****
    type: 'custom:config-template-card'
    variables:
      - 'states[''sensor.fpl_*****''].attributes.service_days'
  - attribute: projected_bill
    entity: sensor.fpl_*****
    name: Projected Bill
    type: entity
type: 'custom:vertical-stack-in-card'

Thanks!!!

dotKrad commented 2 years ago

That was back when it was only on sensor in the integration

today you can use this version


cards:
  - card:
      entities:
        - entity: sensor.fpl_******_as_of_days
          entity_row: true
          max: '${ vars[0] }'
          name: Days
          positions:
            icon: 'off'
            indicator: 'off'
            minmax: inside
            title: inside
            value: inside
          severity:
            - color: Green
              from: 0
              to: '${ vars[0] * 0.5 }'
            - color: Yellow
              from: '${ vars[0] * 0.5 + 1}'
              to: '${ vars[0] * 0.80 }'
            - color: Red
              from: '${ vars[0] * 0.80 + 1}'
              to: '${ vars[0] }'
          style: 'ha-card{border-radius: 0;}'
          type: 'custom:bar-card'
      title: FPL
      type: entities
    entities:
      - sensor.fpl_******_as_of_days
    type: 'custom:config-template-card'
    variables:
      - 'states[''sensor.fpl_******_service_days''].state'
  - entity: sensor.fpl_******_projected_bill
    name: Projected Bill
    type: entity
type: 'custom:vertical-stack-in-card'

where ** is your account number, you should have all sensors already

also you need the custom cards :

custom:bar-card custom:config-template-card custom:vertical-stack-in-card

zoopster commented 2 years ago

Woop! Ah...just removed the attributes...so damn simple. I'm struggling with getting creative on my cards :( Thanks!