npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pvoutput

v1.0.3

Published

simple module to add statuses and retrieve status from pvoutput.org

Downloads

3

Readme

pvoutput

simple module to add statuses and retrieve status from pvoutput.org

usage

initialisation:

const pvoutput = require('pvoutput');

const pvoutputclient = new pvoutput({
    debug: false,
    apiKey: 'xxxxpvoutput_apikey',
    systemId: 'xxxxxpvoutput_systemid'
});

adding a new status

/*
Parameter   Field   Required    Format  Unit    Example Since   
d   Date    Yes yyyymmdd    date    20100830    r1  
t   Time    Yes hh:mm   time    14:12   r1  
v1  Energy Generation   No1 number  watt hours  10000   r1  
v2  Power Generation    No  number  watts   2000    r1  
v3  Energy Consumption  No  number  watt hours  10000   r1  
v4  Power Consumption   No  number  watts   2000    r1  
v5  Temperature No  decimal celsius 23.4    r2  
v6  Voltage No  decimal volts   210.7   r2  
c1  Cumulative Flag No  number  -   1   r1  
n   Net Flag    No  number  -   1   r2  
delay   Net Delay   No  number  -   30  r2  DONATION MODE
v7  Extended Value 1    No  number  User Defined    100.5   r2  DONATION MODE
v8  Extended Value 2    No  number  User Defined    328 r2  DONATION MODE
v9  Extended Value 3    No  number  User Defined    -291    r2  DONATION MODE
v10 Extended Value 4    No  number  User Defined    29  r2  DONATION MODE
v11 Extended Value 5    No  number  User Defined    192 r2  DONATION MODE
v12 Extended Value 6    No  number  User Defined    9281.24 r2  DONATION MODE
*/
pvoutputclient.addStatus({
    datetime: timestamp,
    energyGeneration: solardata.etoday * 1000,
    powerGeneration: solardata.pac1,
    temperature: solardata.temperature,
    voltage: solardata.vac1
}).then(function(result) {
    console.log('successfully sent result to pvoutput');
}).catch(function(err) {
    console.log('could not add pvoutput status' + err.message);
});

getting current status:

/*
* Get status of PV installation
*
* Returns results:
*
* Date yyyymmdd    2016-06-1120100830
* Time hh:mm   19:0714:10
* Energy Generation    number  watt hours  12936
* Power Generation number  watt    202
* Energy Consumption   number  watt hours  19832
* Power Consumption    number  watt    459
* Efficiency   number  kWh/kW  5.280
* Temperature  decimal celsius 15.3
* Voltage  decimal volts   240.1
*/

pvoutputclient.getStatus().then(function(results) {
    console.log(results);
})
.catch(function(err) {
    console.log(err.message);
});

get daily outputs:

/*
* Get output of PV installation
*
* Returns results:
*
* Date yyyymmdd    2016-06-1120110327
* Energy Generated number  watt hours  4413
* Efficiency   number  kWh/kW  0.460
* Energy Exported  number  watt hours  0
* Energy Used  number  watt hours  21859
* Peak Power   number  watts   2070
* Peak Time    19:21hh:mm  11:00
* Condition    -.textShowers
* Min. Temperature number  degrees celsius -3
* Max. Temperature number  degrees celsius 6
* Peak Energy Import   number  watt hours  4220
* Off-Peak Energy Import   number  watt hours  7308
* Shoulder Energy Import   number  watt hours  2030
* High-Shoulder Energy Import  number  watt hours  3888')
*/
pvoutputclient.getOutput().then(function(results) {
    console.log(results);
})
.catch(function(err) {
    console.log(err.message);
});