Home

Awesome

homematic-rega

NPM version dependencies Status Build Status XO code style License

Node.js Homematic CCU ReGaHSS Remote Script Interface

This module encapsulates the communication with the "ReGaHSS" - the logic layer of the Homematic CCU.

i18n placeholders (e.g. ${roomKitchen}) are translated by default.

You can find offical and inoffical documentation of the homematic scripting language at wikimatic.de.

Pull Requests welcome! :)

Install

$ npm install homematic-rega

Usage Example

const Rega = require('homematic-rega');

const rega = new Rega({host: '192.168.2.105'});

rega.exec('string x = "Hello";\nWriteLine(x # " World!");', (err, output, objects) => {
    if (err) {
        throw err;
    } 
    console.log('Output:', output);
    console.log('Objects:', objects);
});

rega.getVariables((err, res) => {
    console.log(res);
});

API

<a name="Rega"></a>

Rega

Kind: global class

<a name="new_Rega_new"></a>

new Rega(options)

ParamTypeDefaultDescription
options<code>object</code>
options.host<code>string</code>hostname or IP address of the Homematic CCU
[options.language]<code>string</code><code>"de"</code>language used for translation of placeholders in variables/rooms/functions
[options.disableTranslation]<code>boolean</code><code>false</code>disable translation of placeholders
[options.tls]<code>boolean</code><code>false</code>Connect using TLS
[options.inSecure]<code>boolean</code><code>false</code>Ignore invalid TLS Certificates
[options.auth]<code>boolean</code><code>false</code>Use Basic Authentication
[options.user]<code>string</code>Auth Username
[options.pass]<code>string</code>Auth Password
[options.port]<code>number</code><code>8181</code>rega remote script port. Defaults to 48181 if options.tls is true

<a name="Rega+exec"></a>

rega.exec(script, [callback])

Execute a rega script

Kind: instance method of <code>Rega</code>

ParamTypeDescription
script<code>string</code>string containing a rega script
[callback]<code>scriptCallback</code>

<a name="Rega+script"></a>

rega.script(file, [callback])

Execute a rega script from a file

Kind: instance method of <code>Rega</code>

ParamTypeDescription
file<code>string</code>path to script file
[callback]<code>scriptCallback</code>

<a name="Rega+getChannels"></a>

rega.getChannels(callback)

Get all devices and channels

Kind: instance method of <code>Rega</code>

ParamType
callback<code>Rega~channelCallback</code>

<a name="Rega+getValues"></a>

rega.getValues(callback)

Get all devices and channels values

Kind: instance method of <code>Rega</code>

ParamType
callback<code>Rega~valuesCallback</code>

<a name="Rega+getPrograms"></a>

rega.getPrograms(callback)

Get all programs

Kind: instance method of <code>Rega</code>

ParamType
callback<code>Rega~programsCallback</code>

<a name="Rega+getVariables"></a>

rega.getVariables(callback)

Get all variables

Kind: instance method of <code>Rega</code>

ParamType
callback<code>Rega~variablesCallback</code>

<a name="Rega+getRooms"></a>

rega.getRooms(callback)

Get all rooms

Kind: instance method of <code>Rega</code>

ParamType
callback<code>Rega~roomsCallback</code>

<a name="Rega+getFunctions"></a>

rega.getFunctions(callback)

Get all functions

Kind: instance method of <code>Rega</code>

ParamType
callback<code>Rega~functionsCallback</code>

<a name="Rega+setVariable"></a>

rega.setVariable(id, val, [callback])

Set a variables value

Kind: instance method of <code>Rega</code>

ParamType
id<code>number</code>
val<code>number</code> | <code>boolean</code> | <code>string</code>
[callback]<code>function</code>

<a name="Rega+startProgram"></a>

rega.startProgram(id, [callback])

Execute a program

Kind: instance method of <code>Rega</code>

ParamType
id<code>number</code>
[callback]<code>function</code>

<a name="Rega+setProgram"></a>

rega.setProgram(id, active, [callback])

Activate/Deactivate a program

Kind: instance method of <code>Rega</code>

ParamType
id<code>number</code>
active<code>boolean</code>
[callback]<code>function</code>

<a name="Rega+setName"></a>

rega.setName(id, name, [callback])

Rename an object

Kind: instance method of <code>Rega</code>

ParamType
id<code>number</code>
name<code>string</code>
[callback]<code>function</code>

<a name="Rega..scriptCallback"></a>

Rega~scriptCallback : <code>function</code>

Kind: inner typedef of <code>Rega</code>

ParamTypeDescription
err<code>Error</code>
output<code>string</code>the scripts output
variables<code>Object.<string, string></code>contains all variables that are set in the script (as strings)

Related projects

License

MIT (c) Sebastian Raff