Home Assistant Community

📝 100% Templatable Lovelace Configurations

lovelace
templates
Tags: #<Tag:0x00007f374dae18d0> #<Tag:0x00007f374dae1718>
#128

Please do let me know too if you figure this out ^^

Cheers

0 Likes

#129

I’m having some fun with this!

Can anyone tell me why one of these works but not the other?

  - type: 'custom:config-template-card'
    config:
      type: 'custom:hui-entities-card'
      title: London Underground
      show_header_toggle: false
      entities:

        - type: custom:card-modder
          style:
            --primary-text-color: "${states['sensor.bakerloo'].state === 'Good Service' ? 'yellow' : 'red' }"
          card:
            type: custom:hui-sensor-entity-row
            entity: sensor.bakerloo
            secondary_info: last-changed

        - type: custom:card-modder
          style:
            --primary-text-color: "${states['sensor.bakerloo'].state === 'Good Service' ? 'yellow' : 'red' }"
          card:
            type: custom:hui-entities-card
            entities:
              - entity: sensor.bakerloo
                secondary_info: last-changed

image

0 Likes

#130

Does anyone have problem with hold_action inside the custom:config-template-card?

The same hold_action works outside of the config-template-card but not inside,
tap_action works in both cases, though.

0 Likes

#131

@iantrich & @thomasloven - Is it possible to combine this with auto-entities and then reference the ‘auto’ entity ID in the template? That could help save a lot of repetitive configuration.

0 Likes

#132

New release 1.0.3

New configuration item entities allows you to specify a list of entity strings that should cause the card to re-render. If nothing specified, any state change will cause a re-rendering (if you’re able to, I would advise setting entities )

@SeLLeRoNe this should resolve your ‘blinking’ issue

2 Likes

#133

Are you able to set primary text of a hui-sensor-entity-row when not using the config-template-card?

0 Likes

#134

I do not have any issues with hold_actions. If you still are, file an issue on the repo with as much detail as possible.

0 Likes

#135

I haven’t played with auto-entities at all, but looking at the repo for auto-entities, I don’t really see how they could work together. @thomasloven any input?

0 Likes

#136

I can’t see it either… But I’m not quite sure what you’re asking. Perhaps you could give an example on what you mean?

0 Likes

#137

Thanks @iantrich
I tested and is not blinking anymore,but still I cannot show the icon with the same code I was using before.

As entity for the updates I simply used sensor.date so that it changes once a day :wink:

1 Like

#138

Tested also using the temperature sensor as entity for updates and it is not blinking

1 Like

#139

Ok, it’s quite odd in my opinion, this is the code:

                      name: "${states['sensor.dark_sky_temperature'].state > 10 ? 'Cozy' : 'Too Hot/Cold'}"
                      icon: "${states['sensor.dark_sky_temperature'].state > 10 ? 'mdi:thermometer-chevron-up' : 'mdi:thermometer-chevron-down'}"

The “name” is working, the “icon” it is not

0 Likes

#140

Sure thing…for example, let’s say I’m using Auto-Entities to populate an Entities card with sensor entities matching a particular entity_id pattern (i.e. each one contains “kitchen”). For each of those matching entities, I would like to override its icon using the template card, based upon an attribute of that matching entity.

As I see it, the problem is that I don’t have a way to pass the name of that matching entity into my template logic in order to do this. I suppose some sort of variable substitution would need to happen inside the template. @thomasloven, this is somewhat similar to what you solved in the card-tool template engine, where you provided the ability to pass a a data object into the template.

At the end of the day, I guess I’m trying to combine the best of the most powerful cards out there. If there was a way for them to play nice together, that would be awesome!

0 Likes

#141

These icons are too new i think. Also don’t work in normal LL.

1 Like

#142

As everyone knows, @thomasloven and I are in a bitter rivalry and are completely unwilling to work together :rofl:

I’ll see what Thomas is currently doing to pass to his templates. :+1:

0 Likes

#143

eheheh so the troll was right, you’re bad person! ahhahhahhha

1 Like

#144

Thanks for the hint, testing it right now but I did also test the standard one to be fair

0 Likes

#145

Is this in entities?

0 Likes

#146

Sorry, I should have put little more context :smiley:

                  - type: custom:config-template-card
                    entities:
                      - sensor.dark_sky_temperature
                    config:
                      type: custom:mini-graph-card
                      name: "${states['sensor.dark_sky_temperature'].state > 10 ? 'Cozy' : 'Too Hot/Cold'}"
                      icon: "${states['sensor.dark_sky_temperature'].state > 10 ? 'mdi:thermometer-chevron-up' : 'mdi:thermometer-chevron-down'}"

0 Likes

#147

Ok, you’re actually right, I didn’t think it would have mattered…

I am trying now with the Font Awesome icons that surely I have :slight_smile:
I will update soon

0 Likes