Linky
Easily retrieve your Linky power consumption
linky-cli
If you are looking for a command-line tool, check outInstall
$ npm i @bokub/linky
Usage
const linky = require('@bokub/linky');
// Log in
linky.login('my-email@example.com', 'password').then(session => {
// Retrieve your power consumption
session.getDailyData().then(data => {
console.log(data);
// [
// { date: '2018-09-28 00:00:00', value: 2.944 },
// { date: '2018-09-29 00:00:00', value: 2.704 },
// { date: '2018-09-30 00:00:00', value: 3.477 },
// { date: '2018-10-01 00:00:00', value: null },
// { date: '2018-10-02 00:00:00', value: 4.063 },
// { date: '2018-10-03 00:00:00', value: 3.209 },
// { date: '2018-10-04 00:00:00', value: 4.355 },
// ...
// ]
});
// Use a custom time period
session.getDailyData({ start: '24/08/2018', end: '06/09/2018' }).then(data => {
console.log(data);
});
});
API
login(email, password)
Log into you customer area and retrieve a session that you can use to retrieve your power consumption
session.getHourlyData([options])
Retrieve power consumption with a step of 30 minutes
Default time period: Yesterday
session.getDailyData([options])
Retrieve power consumption with a step of 1 day
You cannot retrieve more than 31 days at once
Default time period: Last 31 days
session.getMonthlyData([options])
Retrieve power consumption with a step of 1 month
You cannot retrieve more than 12 months at once
Default time period: Last 12 months
session.getYearlyData([options])
Retrieve all your power consumption with a step of 1 year
You cannot use a custom time period