Closed Mariusthvdb closed 4 years ago
Is this fixed? I think it is..?
yes! well, almost. spacing is perfect, thank you sir!
no unit yet though, is that something you are still looking in to please?
The unit's right there in the attributes. Use templating to put it wherever you want it.
Well, im puzzled, I thought to have tried all... please give me a hint how to get the attribute
{{states.[[entity]].attributes.unit_of_measurement}}
on the 'official' spot for unit? Its not for the 'secondary' line, but since this is using 'entity', there is no placeholder for anything besides that? no option for unit listed here: https://github.com/thomasloven/lovelace-template-entity-row#options
By putting in in the state:
just like the state.
state: "{{states(config.entity)}} {{state_attr(config.entity, 'unit_of_measurement')}}"
This row is all about configurability. Having it do everything automatically would ruin the point.
ok thanks, will do. cool.
working nicely!
was not using the 'state' till now, this
card:
type: custom:template-entity-row
entity: '[[entity]]'
secondary: >
{{states.[[entity]].attributes.type}}: {{states.[[entity]].attributes.original_date}}
works just fine ;-) exactly because it takes most automatically from the entity (3d bullet in https://github.com/thomasloven/lovelace-template-entity-row#options)
could I FR adding unit_of_measurement there? It would allow it to be as close to regular entity if wanted, and still allow for all templating options for optimal configurability if so desired.
using:
in a decluttering card causes the name and secondary_info to be placed too closely to the entity_picture of the row.
Compare that to the commented secondary info-entity-row code, which places it correctly:
and uses the 'normal' space between image and name in a entity row, like:
furthermore, it doesn't show the unit_of_measurement, isn't that taken from the entity? if not, please add that too?
please have a look?
HA 106.6 T-E-R 1.1.0 thanks ps also discussed in the community