@vandeurenglenn/niko-home-control
v1.2.0
Published
A connector for the Niko Home Control API
Downloads
8
Maintainers
Readme
Connector for the Niko Home Control API
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 [email protected] github/satblip/niko-home-control