thomasloven / lovelace-template-entity-row

🔹 Display whatever you want in an entities card row.
MIT License
210 stars 16 forks source link

No longer showing `name:` template #61

Closed Mariusthvdb closed 2 years ago

Mariusthvdb commented 2 years ago
        - entity_id: '*_sensor_light_level'
          options:
            type: custom:template-entity-row
            name: >
              {% if state_attr(config.entity,'friendly_name') is not none %}
              {{state_attr(config.entity,'friendly_name').split(' sensor light level')[0]}}
              {% else %} Tbd
              {% endif %}

no longer shows the name: template.

Schermafbeelding 2021-08-18 om 11 59 52

worked just fine before (not sure which change, but either updating to HA 2021.8, or migrating the sensors this template uses to the new template: integration)

dev tools template using the identical template works ok:

Schermafbeelding 2021-08-18 om 11 52 39

and the more-info also shows the correct details:

Schermafbeelding 2021-08-18 om 11 57 57

rest of the config works ok

  - type: custom:auto-entities
    card:
      type: entities
      title: Philips light level raw sensors
      show_header_toggle: false
    filter:
      include:
        - entity_id: '*_sensor_light_level'
          options:
            type: custom:template-entity-row
            name: >
              {% if state_attr(config.entity,'friendly_name') is not none %}
              {{state_attr(config.entity,'friendly_name').split(' sensor light level')[0]}}
              {% else %} Tbd
              {% endif %}
            state: >
              {{state_attr(config.entity,'lightlevel')}} lm
            secondary: >
              {% set light_level = state_attr(config.entity,'lightlevel')|int %}
              {% if light_level < 1 %} dark
              {% elif light_level < 3000 %} bright moonlight
              {% elif light_level < 10000 %} night light
              {% elif light_level < 17000 %} dimmed light
              {% elif light_level < 22000 %} 'cosy' living room
              {% elif light_level < 25500 %} 'normal' non-task light
              {% elif light_level < 28500 %} working / reading
              {% elif light_level < 33000 %} inside daylight
              {% elif light_level < 40000 %} maximum to avoid glare
              {% elif light_level < 51000 %} clear daylight
              {% else %} direct sunlight
              {% endif %}
    sort:
      method: state
      numeric: true
Mariusthvdb commented 2 years ago

ok, so this is behaving again, no idea what happened or why this would have changed:

Schermafbeelding 2021-08-18 om 23 31 59

closing, sorry for the trouble.