Skip to content
This repository was archived by the owner on Feb 16, 2020. It is now read-only.
orlopauPublic archive

About

[DEPRECATED] Retrieves current consumption information from sunnyportal.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

34 Commits

Folders and files

Repository files navigation

Sunnyportal Scraper

NPM

The library is deprectaed. Use the modbus protocol instead.

NodeJS library to retrieve information on PV plants from the Sunnyportal.
Documentation can be found here. An example file is included here

Usage

Import the library and instantiate a new Scraper.

const Scraper = require("sunnyportal-scraper");
const scraper = new Scraper('username', 'password');

Parameters for all operations can be found in the docs.
Setup the scraper. This operation is asynchronous.

await scraper.setup(false); 

Additional parameters can be specified, especially if chromium doesnt run. Refer to puppeteer troubleshooting.

await scraper.setup(false, ['--no-sandbox', '--disable-setuid-sandbox']);

To start the loop that updates the data:

await scraper.start();

// Retrieve data
let data = scraper.getData();

After your application has finished, close the browser instance

await scraper.destroy();

Tests

Tests can be run using Mocha. Username and password have to be provided using environment variables.

SUNNY_USER = username
SUNNY_PASS = password

About

[DEPRECATED] Retrieves current consumption information from sunnyportal.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages