Skip to content

satblip/niko-home-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Connector for the Niko Home Control API

Known Vulnerabilities

Init

const niko = require('niko-home-control');

niko.init({
  ip: 'xxx.xxx.xxx.xxx',
  port: 8000,
  timeout: 20000,
  events: true
});

events enables direct events from the controller, such as energy consumption and actions states.

Usage

Get the list of available locations

niko
  .listLocations()
  .then(function (response) {
    console.log(response);
  });

Get the list of available actions

niko
  .listActions()
  .then(function (response) {
    console.log(response);
  });

Perform an action

niko
  .executeActions(id, value)
  .then(function (response) {
    console.log(response);
  });

Get energy info

niko
  .listEnergy()
  .then(function (response) {
    console.log(response);
  });

Get system info

niko
  .systemInfo()
  .then(function (response) {
    console.log(response);
  });

Reveive energy consumption events

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

Reveive actions states events

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

About

Connector for the Niko Home Control API

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •