1.2.0 • Published 8 months ago

@vandeurenglenn/niko-home-control v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

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

1.2.0

8 months ago

1.1.0

8 months ago

1.0.1

8 months ago

1.0.0

9 months ago