I just started using Home Assistant for my home. I already have a system in place (KNX as backbone) and like to move over to HASS.
I’d like to read the data from my Fronius Solar Inverter. On my current system i call the URL: http:///solar_api/v1/GetInverterRealtimeData.cgi?Scope=System and get a JSON that looks like this:
- platform: rest
resource: http:///solar_api/v1/GetInverterRealtimeData.cgi?Scope=System
name: Total Energy
value_template: '{{ value_json.Body["Data"]["TOTAL_ENERGY"]["Values"]["1"]|float /1000 }}|float /1000 }}'
unit_of_measurement: kWh
I pasted you data in the left hand column here: http://jsonpathfinder.com/ then drilled down in the right hand column to find the path (displayed at the top of the right hand column) and then formatted it in bracket rather than dot notation (less likely to cause errors with key home assistant words like “value”) and divided by 1000 to give a better unit than Wh.
If you use the “minify” button in the left hand column you can copy and paste the result into the developer tools template editor to test your value_template:
It is amazing how some of the “old stuff” still comes in useful. I’ve just swapped to a Fronius (Enphase at the last house) and wanted faster data refresh. REST worked well for me when Enphase was playing API games, so I started to set up my Primo with REST. This proved useful in identifying where my formatting was killing me! (Changes in formats and presentations doesn’t help)