Loxone-NodeJS
Loxone nodejs project to read & control inputs and outputs. Based on http://www.loxone.com/enen/service/documentation/api/webservices.html
Installation
npm install loxone-nodejs --save
Usage
Create a new file 'my-loxone.js'
var LoxoneAPI = ; var loxone = ip: "192.168.1.200" debug: true username: "admin" password: "password"; moduleexports = loxone;
This example connects to a Harmony hub available on the IP 192.168.1.200
.
Also provide a username and password.
In another nodejs file
var loxone = ; loxone;
The following functions are available: get(device, callback)
, getValue(device, callback)
and set(device, action, callback)
.
Extending
Extending 'my-loxone.js'
Add the following code to the my-loxone.js file to expose named functions to read an output.
...loxone { this;};...
AI_SEN2-T
is the name of an output.
In another nodejs file
var loxone = ; loxone;
Examples
Simple Example
This example contains a very example that connects to the Loxone to get the value of a certain output. Configure the my-loxone.js file to point to your Loxone.
cd example-simplenpm installnpm start
Homekit Example
This example is using another node JS project build on top of Homekit Accessory Protocol (HAP): https://github.com/KhaosT/HAP-NodeJS
Configure the my-loxone.js file to point to your Loxone. Also rename the virtual output name in loxone_temperatures.js.
cd example-hapnpm installnpm start
Install a free Homekit app from the App Store to find the homekit accessory.