Skip to content

Latest commit

 

History

History
165 lines (124 loc) · 6.98 KB

README.md

File metadata and controls

165 lines (124 loc) · 6.98 KB

enlighten

The Enlighten Systems API is a JSON-based API that provides access to performance data for a PV system. By using the Enlighten Systems API, you agree to the Enphase Energy API License Agreement.

Please note that the Enlighten Systems API does not provide performance data at a panel or microinverter level.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/NathanBaulch/EnphaseOpenAPI.git"
    }
  ],
  "require": {
    "NathanBaulch/EnphaseOpenAPI": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/enlighten/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: ApiKey
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('key', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$user_id = 4d6a51330a; // string
$system_id = 66; // int
$start_date = Fri Jul 01 10:00:00 AEST 2016; // \DateTime | The date on which to start the time series. Defaults to the system's operational date.
$end_date = Sun Jul 31 10:00:00 AEST 2016; // \DateTime | The last date to include in the time series. Defaults to yesterday or the last day the system reported, whichever is earlier.

try {
    $result = $apiInstance->consumptionLifetime($user_id, $system_id, $start_date, $end_date);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->consumptionLifetime: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.enphaseenergy.com/api/v2

Class Method HTTP request Description
DefaultApi consumptionLifetime GET /systems/{system_id}/consumption_lifetime
DefaultApi consumptionStats GET /systems/{system_id}/consumption_stats
DefaultApi energyLifetime GET /systems/{system_id}/energy_lifetime
DefaultApi envoys GET /systems/{system_id}/envoys
DefaultApi inventory GET /systems/{system_id}/inventory
DefaultApi invertersSummaryByEnvoyOrSite GET /systems/inverters_summary_by_envoy_or_site
DefaultApi monthlyProduction GET /systems/{system_id}/monthly_production
DefaultApi productionMeterReadings GET /systems/{system_id}/production_meter_readings
DefaultApi rgmStats GET /systems/{system_id}/rgm_stats
DefaultApi searchSystemId GET /systems/search_system_id
DefaultApi stats GET /systems/{system_id}/stats
DefaultApi summary GET /systems/{system_id}/summary
DefaultApi systems GET /systems

Models

Authorization

ApiKey

  • Type: API key
  • API key parameter name: key
  • Location: URL query string

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 2.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen