OpenEVSE Session Status – Is EV Connected?

@glyn.hudson @TrystanLea

There appears to be 4 Session states as revealed by the OpenEVSE page – Not Connected, Waiting, Charging & Disabled

The emoncms feed ev_state also shows state. In my case it has shown 254 for the most part over the past few days. Very occasionally it was 1 or 2 and was 3 when charging – so this is not very helpful/informative.

Is it possible to access the Session state? – and if so, how?

I want to create a script (run as a cronjob) that periodically checks whether the EV is connected and if not then sends an advisory text message.

Sending the text message is not the problem – finding the connection status and testing it in a script is the challenge.

Any suggestions/help would be most welcome.

This could be a popular feature – arriving back home and sorting the shopping, kids, etc – very easy to forget to connect the EV ready for the cheap overnight charge.

I’ve experimented with the RAPI commands whilst the Tesla EV was Connected & Ready to Charge as shown by the Tesla Mobile App:

  • Status enquiry $GS gave 254
  • Enable $FE gave OK and charging started. Then Status enquiry $GS gave 3.
  • Sleep $FS stopped the charging and the Session status then showed Waiting
  • Reset $FR looks to be necessary

So a convoluted script approach might be:

  • Send Enable $FE then send Status $GS. If the response is 3 then the EV is charging so it must be connected
  • Send Sleep $FS to put the EV in Session status Waiting
  • Reset $FR
  • Do not send advisory text message – as the connection has been verified
  • Otherwise – send advisory text message

Do you have a less convoluted suggestion?


(Running updated emon v 10.2.6 with DemandShaper v 2.1.2)