3.0.8 • Published 4 years ago
tibber-pulse-connector v3.0.8
A node/browser wrapper for the Tibber Pulse websocket API.
- Breaking change in 2.0.0: Options is now an object.
- Breaking change in 3.0.0: onData now required, exported class renamed (capitalized).
3.0.0 Changelog:
- Added phase voltage and phase current data.
- Internal changes
Parameters:
- token: Required, from the Tibber API
- homeId: Required, from the Tibber API. Either a string or an array of strings.
- onData: Required. On data received. Is called with two variables - (data, homeId)
- onError: Returns any errors from the subscription. Is called with two variables - (data, homeId)
Methods:
- start: Initiates the subscription. Nothing happens until you invoke this.
Example:
const tibber = require('tibber-pulse-connector');
// Test tokens
const token = `d1007ead2dc84a2b82f0de19451c5fb22112f7ae11d19bf2bedb224a003ff74a`;
const homeId = `68e6938b-91a6-4199-a0d4-f24c22be87bb`;
const connector = new tibber({token, homeId, onData: (data, homeId) => { console.log(data, homeId) }});
connector.start();
Multiple home IDs as an array of strings
const tibber = require('tibber-pulse-connector');
// Test tokens
const token = `d1007ead2dc84a2b82f0de19451c5fb22112f7ae11d19bf2bedb224a003ff74a`;
const homeIds = [`68e6938b-91a6-4199-a0d4-f24c22be87bb`, `68e6938b-91a6-4199-a0d4-f24c22be87bb`];
const connector = new tibber({token, homeId: homeIds, onData: (data, homeId) => { console.log(data, homeId) }});
connector.start();
Node, with custom WS implementation:
const tibber = require('tibber-pulse-connector');
const ws = require('ws'); // Remember to add this dependency, doh
// Test tokens
const token = `d1007ead2dc84a2b82f0de19451c5fb22112f7ae11d19bf2bedb224a003ff74a`;
const homeId = `68e6938b-91a6-4199-a0d4-f24c22be87bb`;
const connector = new tibber({token, homeId, ws, onData: (data, homeId) => { console.log(data, homeId) }});
connector.start();
3.0.8
4 years ago
3.0.6
4 years ago
3.0.5
4 years ago
3.0.2
4 years ago
3.0.1
5 years ago
3.0.0
5 years ago
2.1.1
5 years ago
2.1.0
5 years ago
2.0.0
5 years ago
1.2.0
5 years ago
1.1.3
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago