Impossible to map real Entity state for automation

Hello,
I’m trying to wrap my head around this, with no success. So: I have a EV charger and I’d like to trigger an automation every time the car ends the charging process. There is an entity named “EVCharger Charging session status” that - from what I see from the history - has three states: “Not connected”, “Sleep mode” and “Active”.

Screenshot 2024-02-10 164922

So I need to trigger the atuomation every time the status switches from Active to Sleep or from Active to Not connected.

Screenshot 2024-02-10 165406

The problem is that this never fires. Moreover, when I use the GUI configurator, the dropdown shows just two states, that are “Unknown” and “Not available”.

Any Idea?
Thank you so much!

That displays a more verbose “friendly” version of the entity’s actual state value. The State Trigger uses an entity’s actual values not the so-called “friendly” ones.

Go to Developer Tools > States and look at the sensor’s current state value. That’s its actual value and is likely to be different from what you are seeing in its History or the Logbook.

Your entity is a sensor so it can have many possible values. In that case, the UI offers the only two values that are common to all sensors unknown and unavailable. Notice how I typed those two values in lowercase? That’s their actual values as opposed to how they are presented in the UI in titlecase.


tl;dr

Find the sensor’s actual state values and use those in the State Trigger, not the ones you see in the sensor’s History or the Logbook.


EDIT

Which integration produces sensor.XXXXXX_charger_charging_session_status?

It may be possible to inspect the integration’s source code to see all of the sensor’s possible state values. They may simply be lowercase versions of the ones displayed in the UI (or not).

In fact this helped. I was quite suprised to see perfectly formatted and correctly spaced textes as status. In this case, (SMA EV charger) real statuses values are lowercase, no “in” at the beginning and have an underscore “_” as spaces.
Thanks

1 Like