SiteSensor > how to fill in Value Expressions (json data) SOLVED !
-
I still use Vera controllers in combination with ReactorSensors. I have several Reactor sensors in use to retrieve weather data from Wunderground (i have a personal weather station), my smartmeter etc.
Recently I installed solar panels with a SolarEdge inverter. SolarEdge has an API to retrieve my power production data from their cloud.
Output is in json.So I created a new Reactor Sensor. Connection is working (query okay).
But I encounter problems at the Value Expressions. Either I get ""query okay" but no data or I get "query okay but 1 expressions failed"This is the json output
{"overview":{"lastUpdateTime":"2023-05-12 10:45:57","lifeTimeData":{"energy":476310.0,"revenue":216.577},"lastYearData":{"energy":433001.0},"lastMonthData":{"energy":433001.0},"lastDayData":{"energy":8262.0},"currentPower":{"power":5647.0},"measuredBy":"INVERTER"}}
So it has different layers/levels.
I tried to put in the Value Expressions field several combinations to get the energy data of today (8262.0), like:
response.lastDayData.energy
response.overview.lastDayData.energy
response.overview.lastUpdateTime.lastDayData.energyall fail...
Who can help me with this ?
-
Just for clarity, here's the formatted JSON:
{"overview":{ "currentPower":{"power":5647}, "lastDayData":{"energy":8262}, "lastMonthData":{"energy":433001}, "lastUpdateTime":"2023-05-12 10:45:57", "lastYearData":{"energy":433001}, "lifeTimeData":{ "energy":476310, "revenue":216.577 }, "measuredBy":"INVERTER" }}
-
Thanks!
So why does the 2nd option I have mentioned not work?
-
Well.... I tried again with "response.lastDayData.energy" and now it works ?? Really don't know what I did wrong, but now it works.
So problem solved.
Many thanks @akbooer