Closed snakuzzo closed 5 years ago
I'm guessing you want the friendly name. You should try the following:
'states["cover.matrimoniale"].attributes.friendly_name'
I tried with friendly_name and name...same result If I join name and percentage number, the name is showed as undefined
attributes
is the key thing
Thank you! This solved first problem. Now I can see friendly_name and percentage.
This is new code...
variables:
- 'states["cover.matrimoniale"].attributes.friendly_name'
- 'states["input_number.posizione_tapparella_camera"].state'
type: 'custom:config-template-card'
card:
type: '${''custom:hui-entities-card''}'
entities:
- entity: cover.matrimoniale
name: '${vars[0] + " (" + vars[1] + " %)"}'
entities:
- input_number.posizione_tapparella_camera
- cover.matrimoniale
Second problem... is it possible to cast percentage number as integer ???
I'm trying to create a custom card for my blinds. I need to view entity name as "friendly_name (percentage %)". (I'm getting % number from another entity)
This is my card
But this is the result
How can I solve this ? If I use this template for entity name it shows the correct name
- name: '${vars[0]}'
Another question... How can I cast % value as integer ? {vars[1] | int} not works