robgrow
(Robgrow)
October 16, 2024, 7:37am
1
Hi lads,
I want to use the entity input_text.p1_strain to set the title of my entities card.
I do not get it how to - working since days now and I can’t find a solution.
type: entities
entities:
- entity: sensor.plant_sensor_1ef3_temperature
- entity: sensor.plant_sensor_1ef3_moisture
- entity: sensor.plant_sensor_1ef3_illuminance
- entity: sensor.plant_sensor_1ef3_conductivity
title: |
{{ states('input_text.p1_strain') }}
state_color: true
theme: day_and_night
Any ideas? Sensor is delivering data and available.
input_text.p1_strain does have the value Purple Punch.
thanks
Troon
(Troon)
October 16, 2024, 8:00am
2
You can’t use templates in an entities card.
There are custom cards available. Perhaps try this:
1 Like
robgrow
(Robgrow)
October 16, 2024, 8:15am
3
so this should, imho, work but I doesn’t
type: entities
entities:
- type: 'custom:config-template-card'
variables:
- states['input_text.p1_strain'].state
entities:
- sensor.plant_sensor_1ef3_moisture
- sensor.plant_sensor_1ef3_temperature
- sensor.plant_sensor_1ef3_illuminance
- sensor.plant_sensor_1ef3_conductivity
row:
type: section
title: "${vars[0]}"
- entity: sensor.plant_sensor_1ef3_moisture
- entity: sensor.plant_sensor_1ef3_temperature
- entity: sensor.plant_sensor_1ef3_illuminance
- entity: sensor.plant_sensor_1ef3_conductivity
Troon
(Troon)
October 16, 2024, 8:16am
4
Did you install the custom card? What happens with the above config?
robgrow
(Robgrow)
October 16, 2024, 8:18am
5
already double checked it approx. every 2 hours since days cause I doubt by myself
robgrow
(Robgrow)
October 16, 2024, 8:25am
6
card type has changed and the rest is still the same outcome
Troon
(Troon)
October 16, 2024, 8:30am
7
You’re really not giving much information here.
Have you got any custom card working to show that the installation works?
What is “the same outcome”? Description or screenshot would be fine.
robgrow
(Robgrow)
October 16, 2024, 8:39am
8
Ok - sorry for that.
That was the first idea - as you said, it won’t work - It didn’t
Just to make sure - there is data in the entity
That’s now the outcome as I said not much difference
I will go for a shower - hope that helps to get brains clear
Thanks for your precious time
Troon
(Troon)
October 16, 2024, 8:47am
9
Have another look at the examples on the page.
variables:
- states['input_text.p1_strain'].state
with [square brackets] and a .state
on the end.
title: '${vars[0]}'
All templates in the examples are quoted. Your last example is the title of the entities card, which is “outside” the scope of the custom template card.
Perhaps try a simpler example template card to make sure the installation of the card is working.
I have no experience with this card: I’m just reading the docs and using logic.
1 Like
robgrow
(Robgrow)
October 16, 2024, 9:17am
10
Ok - still same issue but… it alters automatically the code after I click safe
There is a special thread for discussing config-template-card.
type: entities
entities:
- type: custom:config-template-card
variables:
- states['sun.sun'].state
entities:
- sun.sun
row:
type: section
label: "${vars[0]}"
- entity: sun.sun
- entity: sun.sun
- entity: sun.sun
or even
type: entities
entities:
- type: custom:config-template-card
variables:
- states['sun.sun']
entities:
- "${vars[0].entity_id}"
row:
type: section
label: "${vars[0].state}"
- entity: sun.sun
- entity: sun.sun
- entity: sun.sun
2 Likes
robgrow
(Robgrow)
October 16, 2024, 2:07pm
12
Thank you for your precious time - that is easy and works fine
on your screenshot you see the line above the label?
That’s where I want to change data - looks like there is no chance to solve this
You want to change a TITLE then, not a section’s label.
type: custom:config-template-card
variables:
- states['sun.sun']
entities:
- sun.sun
- person.ildar
- zone.home
card:
type: entities
title: "${vars[0].state}"
entities:
- type: section
label: fixed label
- entity: sun.sun
secondary_info: last-changed
- entity: person.ildar
secondary_info: last-changed
- entity: zone.home
secondary_info: last-changed
And using CTC (config-template-card) ONLY for changing a card’s title is a bad approach - see how many entities need to be listed in the “entities” option and see how “last-changed” is processed… As I said - more details in the main CTC thread.
1 Like
robgrow
(Robgrow)
October 16, 2024, 2:23pm
14
SOLVED!
Thank you so very much!
But to be honest - I have to work me through this cause I can’t understand the code as originally I was on this way. AI and some questions at the wrong place lead me wrong then.
Thanks so much again!