@vandeurenglenn/niko-home-control

1.2.0 • Public • Published

Connector for the Niko Home Control API

Known Vulnerabilities

Init

import NikoHomeControl  from '@vandeurenglenn/niko-home-control';

const niko = new NikoHomeControl({
  ip: '0.0.0.0',
  port: 8000,
  timeout: 20000,
  events: true
});

try {
  await niko.connect()
  await niko.listActions()
  await niko.startEvents()
} catch (error) {
  console.error(error)
}

Usage

Get the list of available locations

await niko.listLocations()

Get the list of available actions

await niko.listActions()

Perform an action

await niko.executeActions(id, value)

Start listening to events

await niko.startEvents()

Get energy info

await niko.listEnergy()

Get system info

await niko.systemInfo()

Reveive energy consumption events

niko.on('getlive', (data) => {
  console.log(data, 'live');
});

Reveive actions states events

niko.on('listactions', (data) => {
  console.log(data, 'actions');
});

TODO: notice parts of code and readme come from Louis Borsu sat@satprod.net github/satblip/niko-home-control

/@vandeurenglenn/niko-home-control/

    Package Sidebar

    Install

    npm i @vandeurenglenn/niko-home-control

    Weekly Downloads

    0

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    12.4 kB

    Total Files

    10

    Last publish

    Collaborators

    • vandeurenglenn