## Description

Nodejs package to retrieve PV data from a Piko Kostal Inverter.

- Due to the different html layouts provided by each inverter, this library will probably not work with your inverter. I do not mind adding support for additional inverters, just send me a message/email with an html page of your inverter so I can add it to the library.. Right now, the only inverter tested is the Piko 10.1. 

- Parsing using cheerio works only with network-fetched html pages. Currently Working on an offline version, so one can load in a local html. 

## Changelog

~1.0.9: changed the object format for less redundancy

~1.0.5: corrected the css selectors for piko 10.1

~1.0.4: fixed some bugs and added full data export

## Installation

  `npm i pikojs`

## Usage

    var pikojs = require('pikojs');

    var urlData = {
        hostname: "http://yourhostnamehere", // protocol + hostname(or LAN IP)
        port: " ", // external forwarded router port (or '80' if accessed on LAN)
        username: " ", // username for gui login. remove this property if default is 'pvserv'
        password: " " // password for gui login. remove this property if default is 'pvwr'
    };

    var piko = new pikojs(urlData);
    var pvdata; // actual object with the PV data

    piko.getData() // getData returns a Promise
        .then(data => {
            pvdata = data; // store Data to an object for later use
            console.log(data);
        });  



## Tested on

* Piko 10.1