Peter
Active open source contributor
An software engineer
DevOps
Back-end
3+ years for PHP development
PHP 5.3 → PHP 7+
No framework→Slim→Laravel
Working for ITRI currently
Smart Grid technology
npm i green-button-data-converter
var DataWriter = require('green-button-data-converter').DataWriter
var options = {
'interval_duration': 86400,
'time_period_duration': 3600,
'start_date': '2019-07-18 17:00:00',
'interval_readings': [
{date: '1563440400', mwh: 912},
],
'power_of_ten_multiplier': 0,
'uom': 72,
}
var dataWriter = new DataWriter(options)
console.log(dataWriter.output(true))
<?php
use Carbon\Carbon;
use Lee\Green\Button\CustomerDataWriter;
$carbon = Carbon::now(self::$timezone);
$dateTimeString = $carbon->format('Y-m-d\TH:i:s\Z');
$options = [
'title' => 'Green Button Customer Feed',
'account_id' => 'Peter',
'meter_form_number' => 'TD17234599',
'end_device_serial_number' => '99123456',
];
$customerDataWriter = new CustomerDataWriter($options);
$customerDataWriter->setPublishedDateTime($dateTimeString);
$customerDataWriter->setUpdatedDateTime($dateTimeString);
$result = $customerDataWriter->createCustomerAccountData();
composer require lee/php-green-button
https://github.com/peter279k/green-button-converter
https://github.com/peter279k/php-green-button