I have a picture elements card that I am trying to add an image card to for my door lock.
I want to be able to display 4 different images:
closed_locked
closed_unlocked
open_locked
open_unlocked
I have created a sensor.front_door that returns the above values based on the lock status and a door sensor status.
Best option i have so far is to use the sensor as the entity for the image card, but then i am no longer able to toggle the lock, which i need to be able to do.
If you are using a picture card or picture elements card, then you have the option of tap_actions. You will be able to toggle the lock. See the documentation.
The image element with state_image should be able to show 4 different images based on sensor.front_door.
Add different tap_/double_tap_/hold_action as lock.lock and lock.unlock service to control the lock entity, i.e. lock.front_door?, should work.
I was thinking something like this.
The example will show different image based on (sensor.hp_kitchen): ac, fan, unit off.
The tap_action toggles light.kitchen.
If you want separate action, then tap_action to turn_on, double_tap_action to turn_off.