Is it possible to do styling on the elements in the picture-elements lovelace card based on the state of an entity?
See below example, I want the state-label to be red when the state is not equal to ‘home’.
This question is also for the image, because it only supports ‘state_filter’, where I need a ‘state_not_filter’ or something like that:
Yeah I have thought of that option, but as you said it is pretty cumbersome with a lot of duplicate configuration which I would like to avoid where I can
You can’t just apply styes to elements, because lovelace does that by itself, and I don’t want to mess anything up with card-mod.
However, you can define a css variable on the elements card, and use that in the element style definition.
Note te placement of the style element. It only seems to work on the horizontal-stack, but not on the picture-elements card. When it is on the picture-elements card however, I do see a quick red flash but then it becomes the default color.
Hey, did you solve this one? I’m having the same trouble too, it doesn’t seem to work on picture-elements card. For me it doesnt even flash, it just remains default color.
does anyone know how to do dynamic values to the state_filter ?
i can set the icon color etc with styles as mentioned above using style css
but i want to se the state_filter saturate and opacity based on computed values
I need a little help with this. I am trying to dynamically change my background image based on the state of a boolean. Any advice? I am just getting a black background now.
This is about changing a background for a view. This thread is about customizing parts of picture-elements card. If you wanna change a view’s background dynamically - consider using a card-mod-theme solution (go to a corresponding thread for details).