npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homematic-rega

v1.5.2

Published

Homematic CCU ReGaHSS Remote Script Interface

Downloads

1,198

Readme

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)

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

rega.exec(script, [callback])

Execute a rega script

Kind: instance method of Rega

| Param | Type | Description | | --- | --- | --- | | script | string | string containing a rega script | | [callback] | scriptCallback | |

rega.script(file, [callback])

Execute a rega script from a file

Kind: instance method of Rega

| Param | Type | Description | | --- | --- | --- | | file | string | path to script file | | [callback] | scriptCallback | |

rega.getChannels(callback)

Get all devices and channels

Kind: instance method of Rega

| Param | Type | | --- | --- | | callback | Rega~channelCallback |

rega.getValues(callback)

Get all devices and channels values

Kind: instance method of Rega

| Param | Type | | --- | --- | | callback | Rega~valuesCallback |

rega.getPrograms(callback)

Get all programs

Kind: instance method of Rega

| Param | Type | | --- | --- | | callback | Rega~programsCallback |

rega.getVariables(callback)

Get all variables

Kind: instance method of Rega

| Param | Type | | --- | --- | | callback | Rega~variablesCallback |

rega.getRooms(callback)

Get all rooms

Kind: instance method of Rega

| Param | Type | | --- | --- | | callback | Rega~roomsCallback |

rega.getFunctions(callback)

Get all functions

Kind: instance method of Rega

| Param | Type | | --- | --- | | callback | Rega~functionsCallback |

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

Set a variables value

Kind: instance method of Rega

| Param | Type | | --- | --- | | id | number | | val | number | boolean | string | | [callback] | function |

rega.startProgram(id, [callback])

Execute a program

Kind: instance method of Rega

| Param | Type | | --- | --- | | id | number | | [callback] | function |

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

Activate/Deactivate a program

Kind: instance method of Rega

| Param | Type | | --- | --- | | id | number | | active | boolean | | [callback] | function |

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

Rename an object

Kind: instance method of Rega

| Param | Type | | --- | --- | | id | number | | name | string | | [callback] | function |

Rega~scriptCallback : function

Kind: inner typedef of Rega

| Param | Type | Description | | --- | --- | --- | | err | Error | | | output | string | the scripts output | | variables | Object.<string, string> | contains all variables that are set in the script (as strings) |

Related projects

License

MIT (c) Sebastian Raff