PHP code example of pforret / sunnysideup
1. Go to this page and download the library: Download pforret/sunnysideup library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pforret / sunnysideup example snippets
$sunny = new SunnySideUp();
$response = $sunny::get("https://region04eu5.fusionsolar.huawei.com/pvmswebsite/nologin/assets/build/index.html#/kiosk?kk=$id");
json
{
"stationData": {
"url": "https:\/\/region04eu5.fusionsolar.huawei.com\/rest\/pvms\/web\/kiosk\/v1\/station-kiosk-file?kk=(key)",
"name": "(name)",
"id": "(id)",
"address": "(address)",
"city": null,
"country": null,
"timezone": null,
"panel_count": null,
"watt_peak": null,
"date_commissioning": null
},
"dayWeather": {
"timeSunrise": null,
"timeSunset": null,
"maxTemperature": null,
"currentTemperature": null,
"currentPrecipitation": null
},
"currentData": {
"currentPowerKw": 0.64,
"timeSampled": null
},
"dayProduction": {
"kwhSystem": 8.72,
"equivalentTrees": null,
"equivalentKgCoal": null,
"equivalentKgCo2": null
},
"monthProduction": {
"kwhSystem": 98.2,
"equivalentTrees": null,
"equivalentKgCoal": null,
"equivalentKgCo2": null
},
"yearProduction": {
"kwhSystem": 129.46,
"equivalentTrees": 1,
"equivalentKgCoal": 51.78,
"equivalentKgCo2": 61.49
},
"totalProduction": {
"kwhSystem": 184.84,
"equivalentTrees": 1,
"equivalentKgCoal": 73.94,
"equivalentKgCo2": 87.8
}
}
json
{
"stationData": {
"url": "https:\/\/www.sunnyportal.com\/Templates\/PublicPageOverview.aspx?page=3e371bac-b19a-4257-853c-aac4d3601c0b&plant=46e9985f-128a-4da8-a70d-e95f72085ca4&splang=en-US",
"name": null,
"id": null,
"address": null,
"city": null,
"country": null,
"timezone": "Romance Standard Time",
"panel_count": null,
"watt_peak": 1800,
"date_commissioning": ""
},
"dayWeather": {
"timeSunrise": null,
"timeSunset": null,
"maxTemperature": null,
"currentTemperature": null,
"currentPrecipitation": null
},
"currentData": {
"currentPowerKw": 138,
"timeSampled": "2023-02-24T09:45:00"
},
"dayProduction": {
"kwhSystem": 0.077,
"equivalentTrees": null,
"equivalentKgCoal": null,
"equivalentKgCo2": 0.054
},
"monthProduction": {
"kwhSystem": null,
"equivalentTrees": null,
"equivalentKgCoal": null,
"equivalentKgCo2": null
},
"yearProduction": {
"kwhSystem": null,
"equivalentTrees": null,
"equivalentKgCoal": null,
"equivalentKgCo2": null
},
"totalProduction": {
"kwhSystem": 16385,
"equivalentTrees": null,
"equivalentKgCoal": null,
"equivalentKgCo2": 11000
}
}