Skip to content

pforret/SunnySideUp

Repository files navigation

Solar monitoring site data retrieval

Latest Version on Packagist Tests Total Downloads

works for

  • FusionSolar (Huawei) - Kiosk URL
  • SunnyPortal (SMA Solar) - PV System Overview URL
  • ...

Installation

You can install the package via composer:

composer require pforret/sunnysideup

Usage

$sunny = new SunnySideUp();
$response = $sunny::get("https://region04eu5.fusionsolar.huawei.com/pvmswebsite/nologin/assets/build/index.html#/kiosk?kk=$id");

Retrieved data

Huawei/FusionSolar Kiosk URL

{
    "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
    }
}

SMA/SunnyPortal.com URL

{
    "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
    }
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.