Start a new topic

MQTT Vehicle Session?

Hi,  I can't seem to figure out how to get the most recent charging session informaiton from MQTT (or RAPI).

I see that the web UI can show the last charge energy and elapsed time, but there doesn't seem to be a standard MQTT for this.

Maybe I can get it through a request/response with RAPI but I can't figure that out either.

Thank you!

1 Comment

To get the most-recent charging session (since last unplugged) energy use, publish a message to openevse/rapi/in/$GU and it will respond to openevse/rapi/out with something like $OK 40629846 165327^27

The first number is the most recent session energy in watt-seconds and the second number is the total energy in watt-hours (the ^27 is a checksum from what I read in the source code.)

Unfortunately since every RAPI message is published to a generic topic (/rapi/out), it is impossible to know for sure that message is in response to a particular request.  With my current level-of-knowlege, I cannot use the MQTT RAPI reliably.  I wish that the MQTT RAPI API published the responses to something like /rapi/out/$XX instead of just /rapi/out, then it would be trivial to assign responses correctly even in a multithreaded environment.

Fortunately there is the HTTP REST API and that is what I am using with Home Assistant at the moment.

Login or Signup to post a comment