dkruyt / ginlong-scraper

A python script that scrapes PV statistics from the Ginlong monitor pages and outputs it to influxdb, pvoutput or mqtt
GNU General Public License v3.0
48 stars 30 forks source link

DC_Power_PV1 (1s) isn't in the JSON data #13

Open jturnbull opened 3 years ago

jturnbull commented 3 years ago

Hi, firstly thanks for all your work on this project!

When pulling the data from my Ginlong account, I get an error due to DC_Power_PV1 being None (so it can't cast to float). I've fixed the float casting issue in PR #12.

However, I still have the issue that my data JSON doesn't have the key "1s", so DC_Power_PV1 is always empty.

Weirdly, the number is in the wider JSON response, under "realTimeDataPower":

"realTimeDataOther": [{
    "key": "1jq",
    "name": "System Time",
    "value": "21-1-7 10:49:59"
}],
"realTimeDataPower": [
...
     {
    "key": "1s",
    "name": "DC Power PV1",
    "unit": "W",
    "value": "84.90"
}],
"realTimeDataSetamEngine": [],
"realTimeDataState": [],
"realTimeDataTemp": [],

Do you know of any reason why this might be?

dkruyt commented 3 years ago

I don’t know, maybe different converter gives different fields?

what hardware you have?