Skip to content

VandeurenGlenn/niko-home-control

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Connector for the Niko Home Control API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 55.5%
  • TypeScript 44.5%