iantrich / config-template-card

📝 Templatable Lovelace Configurations
MIT License
434 stars 56 forks source link

Not being able to see states? #44

Closed giuliandenicola1 closed 3 years ago

giuliandenicola1 commented 3 years ago

Checklist:

Release with the issue: 1.2.0 HA: 0.115.6

Browser and Operating System: Chrome on windows and android HA app on android

Description of problem: Tried the "Templated entities example" modified it with my light entity and got a blank page. I opened dev tools -> console It seems not to be able to see states.

  - path: home
    title: Home
    visible: true
    panel: false
    cards:
      - type: custom:config-template-card
        variables:
          - states['light.bulb_couch_lr'].state
        entities:
          - '${vars[0]}'
        card:
          type: entities
          entities:
          -  entity: '${vars[0]}'
          -  name: "${states[vars[0]].state === 'on' ? 'Light On' : 'Light Off'}"

image

iantrich commented 3 years ago

A light has a state of 'on' or 'off', which you're using as the entity_id. That won't work. That example assumes the value of the sensor is an entity_id.