1.5.2 • Published 4 years ago

homematic-rega v1.5.2

Weekly downloads
274
License
MIT
Repository
github
Last release
4 years ago

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.

  • execute arbitrary scripts
  • get names and ids of devices and channels
  • get variables including their value und meta data
  • set variable values
  • get programs
  • execute programs
  • activate/deactivate programs
  • get rooms and functions including assigned channels
  • rename objects

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

Rega

Kind: global class

new Rega(options)

ParamTypeDefaultDescription
optionsobject
options.hoststringhostname or IP address of the Homematic CCU
options.languagestring"de"language used for translation of placeholders in variables/rooms/functions
options.disableTranslationbooleanfalsedisable translation of placeholders
options.tlsbooleanfalseConnect using TLS
options.inSecurebooleanfalseIgnore invalid TLS Certificates
options.authbooleanfalseUse Basic Authentication
options.userstringAuth Username
options.passstringAuth Password
options.portnumber8181rega remote script port. Defaults to 48181 if options.tls is true

rega.exec(script, callback)

Execute a rega script

Kind: instance method of Rega

ParamTypeDescription
scriptstringstring containing a rega script
callbackscriptCallback

rega.script(file, callback)

Execute a rega script from a file

Kind: instance method of Rega

ParamTypeDescription
filestringpath to script file
callbackscriptCallback

rega.getChannels(callback)

Get all devices and channels

Kind: instance method of Rega

ParamType
callbackRega~channelCallback

rega.getValues(callback)

Get all devices and channels values

Kind: instance method of Rega

ParamType
callbackRega~valuesCallback

rega.getPrograms(callback)

Get all programs

Kind: instance method of Rega

ParamType
callbackRega~programsCallback

rega.getVariables(callback)

Get all variables

Kind: instance method of Rega

ParamType
callbackRega~variablesCallback

rega.getRooms(callback)

Get all rooms

Kind: instance method of Rega

ParamType
callbackRega~roomsCallback

rega.getFunctions(callback)

Get all functions

Kind: instance method of Rega

ParamType
callbackRega~functionsCallback

rega.setVariable(id, val, callback)

Set a variables value

Kind: instance method of Rega

ParamType
idnumber
valnumber | boolean | string
callbackfunction

rega.startProgram(id, callback)

Execute a program

Kind: instance method of Rega

ParamType
idnumber
callbackfunction

rega.setProgram(id, active, callback)

Activate/Deactivate a program

Kind: instance method of Rega

ParamType
idnumber
activeboolean
callbackfunction

rega.setName(id, name, callback)

Rename an object

Kind: instance method of Rega

ParamType
idnumber
namestring
callbackfunction

Rega~scriptCallback : function

Kind: inner typedef of Rega

ParamTypeDescription
errError
outputstringthe scripts output
variablesObject.<string, string>contains all variables that are set in the script (as strings)

Related projects

License

MIT (c) Sebastian Raff

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.1

4 years ago

1.4.0

5 years ago

1.3.8

5 years ago

1.3.7

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago