You can trigger automations with the automation.trigger service. The second half of your question is ambiguous. What do you mean “presentation”.
Also, picture entity doesn’t really have anything to do with this, unless that’s what you mean by presentation.
As for changing cards based on states of items, many cards have a build in ‘state’ clauses that change things on the card in question. There’s also entity_filter cards that filters out items on your card. There’s conditional card that will conditionally display the card. And that’s just the built in cards. When you start going custom, the options are endless.
My recommendation: State exactly what you want with explicit instructions on what you expect.
Sorry for not being clear, will try to shed some light.
I need Lovelace cards that control stuff to use short pulses (lights/gates/curtains are controlled by traditional relays, installed 17y ago, and to difficult to change).
Since there is not a button card (yet) that sends pulses, I’m using automations triggered by a Lovelace card.
These automations call the switch on/off service with a delay to simulate a pulse, which trigger switch ‘A’.
So far, this works.
I have state addresses coming, from let’s say switch ‘B’, which represent the actual state because switch ‘A’ has gone to it’s original state after that pulse.
How can I use the state of switch ‘B’ to represent the actual state/image of the Lovelace card that controls switch ‘A’ (through the pulse automation)?
Now that I see the code it’s so obvious…
I honestly had no clue that you can use a different entity as the main one and refer to another in the automation.
1 more thing: the ‘a’ and ‘b’ in the state_image of your code; in the documentation ‘on’ and ‘off’ is being used.
Did you put ‘a’ and ‘b’ between quotes because it can be anything or because it’s needed for functionality?