Start a new topic

JSON format in MQTT?

I'm trying to do solar diversion or eco mode and I got envoy data via MQTT but the meter readings are in JSON format. Should there be a way I can parse the JSON data and extract the number that I need without using home assistant or another program to parse the json and re-publish to different mqtt topic?


You will need to use something like Node-Red, Python or Home Assistant to get the data out of JSON format.

Here is an example in Python for the Tesla Energy Gateway. The example grabs data via HTTP in JSON format, parses out the data and sends to MQTT.


https://github.com/OpenEVSE/Solar_MQTT

Okay done. I adapted https://github.com/vk2him/Enphase-Envoy-mqtt-json to extract grid import/export for phaseA, phaseB and add it together and publish a total grid_power topic in MQTT.

How exactly did you get this working?  I got https://github.com/vk2him/Enphase-Envoy-mqtt-json running OK, but I'm unsure what to put in the "Feed" field in OpenEVSE to get it to work with eco mode.  

Login or Signup to post a comment