Closed JL00001 closed 2 weeks ago
I just retried this code and it worked fine -- you might need to install cURL on your system. I don't know if it always installs by default.
if it works, you will get an output similar to :
"{"code":0,"msg":"Success","data":{"custCode":29,"meterCode":0,"pvPower":2892,"battPower":2324,"gridOrMeterPower":0,"loadOrEpsPower":392,"genPower":0,"minPower":0,"soc":100.0,"pvTo":true,"toLoad":true,"toGrid":false,"toBat":true,"batTo":false,"gridTo":false,"genTo":false,"minTo":false,"existsGen":false,"existsMin":false,"genOn":false,"microOn":false,"existsMeter":false,"bmsCommFaultFlag":false,"pv":null,"existThinkPower":false},"success":true}" array(25) { ["custCode"]=> int(29) ["meterCode"]=> int(0) ["pvPower"]=> int(2892) ["battPower"]=> int(2324) ["gridOrMeterPower"]=> int(0) ["loadOrEpsPower"]=> int(392) ["genPower"]=> int(0) ["minPower"]=> int(0) ["soc"]=> float(100) ["pvTo"]=> bool(true) ["toLoad"]=> bool(true) ["toGrid"]=> bool(false) ["toBat"]=> bool(true) ["batTo"]=> bool(false) ["gridTo"]=> bool(false) ["genTo"]=> bool(false) ["minTo"]=> bool(false) ["existsGen"]=> bool(false) ["existsMin"]=> bool(false) ["genOn"]=> bool(false) ["microOn"]=> bool(false) ["existsMeter"]=> bool(false) ["bmsCommFaultFlag"]=> bool(false) ["pv"]=> NULL ["existThinkPower"]=> bool(false) }
if you want to directly intercept data from the WiFi dongle, check out this repo I just updated:
Ok, I have and some time to come back to this. Using the developer tools in chrome and logging in to the Sol-Ark plant page. I can see some of the api calls the webpage does.
https://www.solarkcloud.com/api/v1/plant/energy/
flow, what you used in your PHP script, seems to have how the power is flowing in the system. realtime, seems to have how the real time amount, as well as the running totals day, seems to have the raw data for the day in the url. use, seems to have weights for how the sol-ark decides things? Speculation on this part.
https://www.solarkcloud.com/api/v1/plant/energy/
Has totals for plant
Is there an api guide for the Sol-ark access? I am looking to pull some data from Sol-ark's website and have been trying to access it in the way you described in your php code, but keep getting HTTP Error 405 Not Allowed.