Nobody's Perfect, Man

    niko-home-control

    0.4.3 • Public • Published

    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');
    });

    Install

    npm i niko-home-control

    DownloadsWeekly Downloads

    5

    Version

    0.4.3

    License

    MIT

    Last publish

    Collaborators

    • satblip