Have Entity Card User Sensor Value as Part of Title

Hi,

Trying to make a custom title for an entity card. Not sure what is missing but the code below should look like this for the title

CyberPower OR1000LCDRM1U

title: CyberPower {{ states('sensor.ups_modelname') }}

image

Tried following this discussion, but the person asking for help was going off a template.

as far as I know you can only do that in a markdown card or mushroom template/title card.

Most core cards do not accept templates.

You can use this with the core cards though:

1 Like

Hi,

Thanks for offering to help. Not sure if I wasn’t clear. I think your replying to the last poster and not me the topic originator. I am not using a template card. Hoping to do what I’d like with the title in an entity card. If its not possible, not a big deal. Just something I wanted to explore.

Thank you

No, I was replying to you. If you use the resource in the link I posted then you can use templates in any card that would not normally accept them.

I will give it a try over weekend. thank you.

This returns no errors, but I see nothing on the card. Its blank.

type: custom:config-template-card
entities:
  - entity: sensor.ups_serialno_2
    name: Serial Number
  - entity: sensor.ups_status_2
    name: Status
  - entity: sensor.ups_load_2
    name: Load
  - entity: sensor.ups_timeleft_2
    name: Time Left
  - entity: sensor.ups_nominv_2
    name: Nominal Input Voltage
  - entity: sensor.ups_nompower_2
    name: Nominal Output Power
card:
  type: entities
  title: ${"CyberPower" + sensor.ups_modelname_2}

Trying to take this code work for what I need:

type: custom:config-template-card
entities:
  - sun.sun
card:
  type: entities
  title: ${"Hello, " + user.name}
  entities:
    - sun.sun

Try asking in the support topic for the template card. I don’t use it but others in that topic do and may be able to provide an answer.

Here is an example to try…

type: custom:config-template-card
variables:
  STATE: states['sensor.ups_modelname_2'].state
entities:
  - sun.sun
card:
  type: entities
  title: ${"CyberPower " + STATE}
  entities:
    - sun.sun

This worked perfectly @LiQuid_cOOled. Is there any way to control the font size of the title

image

Go to the main card-mod thread → 1st post → link at the bottom → entities card → styling a title.

1 Like

my advice wood be to bookmark that post by @Ildar_Gabdullin, it has everything you’ll ever need

1 Like

Also, it was already suggested to ask config-template-card-related questions in the corr. thread.

Will do. Will continue with questions in that thread. thanks for the help.

Since Jay already helped you with templating a title (and you marked his advice as a solution), you got only one question left about “font size for title”. Suggest to discuss it in that huge card-mod thread if advices provided here are not enough.

A general remark.
You got Entities card with N entities.
And you need to make a title dynamic.
For this you decide to place the whole Entities card into the config-template-card (CTC).
Then you will probably have to add all entities used inside the Entities card into “entities” option of CTC - otherwise the inner card (here - Entities) will not be updated inside CTC if any of these entities changes.
Means - the whole inner card will be redrawn, not only a corr. row.
If you decide to add a graph card inside CTC - this redraw may cause flickering.
So - you should use CTC only when it is really needed - or entities inside inner card rarely change.
Using CTC only to template a title is not a good idea.
Suggest to use a markdown instead.
Here is an example.