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.

Okay done. I adapted to extract grid import/export for phaseA, phaseB and add it together and publish a total grid_power topic in MQTT.

Login or Signup to post a comment