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

[DEPRECATED] Retrieves current consumption information from sunnyportal.

License

Notifications You must be signed in to change notification settings

orlopau/sunnyportal_scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published