0.0.15 • Published 7 years ago

loxone-nodejs v0.0.15

Weekly downloads
15
License
ISC
Repository
github
Last release
7 years ago

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 = require('loxone-nodejs');

var loxone = new LoxoneAPI({
    ip: "192.168.1.200",
    debug: true,
    username: "admin",
    password: "password"
});

module.exports = 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 = require('./my-loxone');

loxone.get("AI_SEN2-T", function(output){
    if (output.LL.Code == 200) {
        console.log('Device does exists!');
        console.log('Value = ' + output.LL.value);
    } else {
        console.error('Device does NOT exists!');
    }
});

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.getOutsideTemperature = function(callback) {
    this.getValue("AI_SEN2-T", callback);
};
...

AI_SEN2-T is the name of an output.

In another nodejs file

var loxone = require('./my-loxone');

loxone.getOutsideTemperature(function(value) {
    console.log("The outside temperature is: " + value + "°C");
});

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-simple
npm install
npm 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-hap
npm install
npm start

Install a free Homekit app from the App Store to find the homekit accessory.

0.0.15

7 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago