Situation: I have some cameras that I’m displaying with the picture-glance card. The cameras are from ZoneMinder, so they have event counts as state.cam1_events, which is a number value. I would like to be able to display that number in the entities list, but it doesn’t seem like there’s any way to do that without dropping it to a new line and looking pretty bad.
For an example, here’s what happens when I set show_state: true on the entity:
I would prefer if the value (and the value alone) were able to display next to the icon (or in place of the icon). But there doesn’t appear to be any way to configure entities with templates on a picture-glance card.
The picture-glance card configuration does not appear to accept icon_template. It’s also not a thing that I want set globally, since the actual number can be infinite.
Right, that’s why you have to make a template sensor…
That’s fair, unfortunately, you’ll have to make a custom card and style it yourself. Currently those fields only accept icons above text. Moving the text to the side requires you to change the layout.
Ohhh… a template sensor. Sorry I must have glossed over that part.
Would be really awesome if icon_template and name_template were built-in everywhere icon and name were accepted in lovelace. I think that would really open up some interesting abilities.
This inserts the corresponding code after the “title” of the picture glance card (which is “CAM1” in your example). To insert it before/after other elements, just inspect the HTML and figure out a convenient element to put your text before/after.
Under firefox debugger is giving me the following error
Card-mod r: At path: style -- Expected a value of type `never`, but received: `".box {\n background-color: rgba(0, 0, 0, 0.2) !important\n} \n.box::after {\n content: \" [ {{ states('sensor._last_sale_price') }}€ ] \";\n}\n"`
r error.ts:41
d struct.ts:195
f struct.ts:125
value hui-picture-glance-card-editor.ts:76
value card-mod.js:1
i card-mod.js:1
value hui-element-editor.ts:377
card-mod.js:1:53251