Picture elements: Use an attribute for state_image

Is it possible to use an attribute to drive a state_image?
I want to use attributes to determine what kind of image I project on the base image.

Thanks,

Thomas

1 Like

If you need to use an entity’s attribute to determine a ”state_image” option for an “image” element inside picture elements card - you have to create a template sensor for this attribute.
Alternatively, it could be probably achieved by card-mod: define a background image dependently on an attribute - but I would not recommend it.

1 Like

I feared as much, will be a lot of new template sensors.

Are you interested in displaying graphs for these attributes ? If yes - you need to create template sensors.

No, using a big image of my car, on which the properties of various doors, hood, boot, winbows are displayed as overlay image of that particular door being open.
All these are under the “Lock” sensor in its attribute.

grafik

Something like that.

In my setup all doors, hood and rear door (forgot an English word…) are “cover” entities.
For each entity a logbook card may be used to see a history if needed.

These elements have to be presented by state_image as different images; cardmod is a worse alternative here.