This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

tibber-pulse-connector
TypeScript icon, indicating that this package has built-in type declarations

3.0.8 • Public • Published

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();

Build Status

DeepScan grade

Readme

Keywords

Package Sidebar

Install

npm i tibber-pulse-connector

Weekly Downloads

0

Version

3.0.8

License

Unlicense

Unpacked Size

22.3 kB

Total Files

20

Last publish

Collaborators

  • kvasbo