PHP code example of ebaschiera / pvoutput

1. Go to this page and download the library: Download ebaschiera/pvoutput 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/ */

    

ebaschiera / pvoutput example snippets


//during the day
$pvoutput = new \PVOutput\PVOutput($system_id, $api_key);
$pvoutput->addStatus(2500, 1500); //sends instant generation and consumption


//at the end of the day
$pvoutput = new \PVOutput\PVOutput($system_id, $api_key);
$pvoutput->addOutput(NULL, 9000, 3100, $peak_output_datetime, 8000, 1000);
//sends generated energy, peak generation power, peak generation datetime, consumed energy, exported energy


//get a full month aggregated output
$start_date = \DateTime::createFromFormat('Ymd', '20150401');
$end_date = \DateTime::createFromFormat('Ymd', '20150430');
$pvoutput = new \PVOutput\PVOutput($system_id, $api_key);
$pvoutput->getOutput($start_date, $end_date, 'm');