API

3 comments started 2022-02-12 last 2022-02-15
APIsHome Automation
S
#1 stevelewis

Time missing from getPlantSummary call

Hi,
I'm using the getPlantSummary to download 5-minute data. Maybe it's a feature of how the API has grown over time, but shouldn't there be a time field returned alongside the data. Is there another way of identifying when the data was uploaded from the plant? Or is another API call better suited to capturing the (almost) live data?

Cheers

Steve

#2 hoggy

Plant summary doesn't have a date, as it's just "NOW" so assumes you don't need it/already know it.
If you want latest live data with a timestamp then it's probably going to be this one from the Misc API:
https://www.givenergy.cloud/GivManage/invData/**$SerialNum**/**yyyy-MM-dd**?page=1&rows=1

Example Output:
{"total":174,"rows":[{"vpv2":"177.30","vpv1":"288.40","loadPower":"289.00","moduleVoltage":"53.40","importEnergyToday":"7.90","ppv2":"45.00","exportEnergyToday":"0.10","fac":"49.96","invImportEnergyToday":"6.40","invImportEnergyTotal":"1901.40","batPower":"31.00","ppv1":"78.00","ipv2":"0.20","ipv1":"0.20","pac":"-129.00","pacr":"0.00","meter2ActivePower":"-129.00","pacs":"0.00","pact":"0.00","invVoltage":"244.30","temperature":"25.80","batCurrent":"0.58","batPercent":"31.00","meter2PowerFactor":"10820.00","meter1ActivePower":"180.00","runtime":"8459.00","invFrequency":"49.94","vact":"5743.00","eacTotal":"7749.10","vacs":"0.00","eacToday":"4.70","vacr":"246.60","gridExportEnergyTotal":"3474.50","meter2ApparentPower":"483.00","batVoltage":"53.25","iacr":"1.20","ppv":"123.00","iact":"6273.90","iacs":"0.00","time":"2022-02-13
14:43:48","chgTemperature":"26.10","batTemperature":"10.00","gridImportEnergyTotal":"7067.80","status":"NORMAL"}]}

The "rows" bit set to 1 just returns the latest "row" of data. Picking a higher number just returns more of the history.
The only PITA is having to set the date variable all the time. I do this in powershell personally

S
#3 stevelewis

hoggy
Thanks, I hadn't spotted that one. Much better with all of the fields I need in a user-friendly format.