JSON Webservice - ESP8266 from SolarMPPT Charger, no clue

Hi all, i’m not that good in transformation services and wanted to know how would i do best a JSON transformation.
An ESP8266 provides a webservice with data from the solarpanel, battery, … so I have an IP address plus a subpage that provides following output

{"pvVoltage":0.00, "pvCurrent":0.00, "pvPower":0, "batteryVoltage":23.73, "batteryChargingCurrent":0.00, "batteryChargingPower":0, "loadVoltage":23.73, "loadCurrent":0.00, "loadPower":0, "batteryTemp":0.00, "equipmentTemp":21.17, "heatsinkTemp":21.17, "batterySoC":28, "batteryRemoteTemp":0.00, "batteryRatedPower":24}

What do i need to do in order to e.g. have an item BattVoltage that reads from the JSON every minute the 23.73V.

Thanks for some directions…Norbert

What binding will you be using, does it support transformations?

Sorry, that would be part of my question…if openhab is able to read an http link every minute that replys the JSON above…and further transform it into an item value.

That was my naive approach.

That’s what HTTP binding is made for.
As you are likely to eventually want to extract more than one value from your JSON, set it up to fetch to cache each minute.
Then link Item(s) to cache.
While developing, link a String Item with default transform, so that you can view the whole payload.
If it is pure JSON, use JSONPATH transform with each real Item to extract the value you want.

Note that it’s an OH version 1.x binding, you may not have used one before. You’ll ned to enable legacy bindings. It doesn’t use Things and channels, it is configured partly in a xxx.cfg file and partly in the Items, which you will also need to define in xxx.items file

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.