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?


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.

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

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

Login or Signup to post a comment