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

node-red-contrib-fibaro-hc2-bridge

v0.2.0

Published

A bridge between Fibaro HomeCenter 2 and NodeRed

Downloads

14

Readme

A bridge between Fibaro HomeCenter 2 and NodeRed

The node connects to a HomeCenter and listens for device property changes, gives devices friendly identifiers (e.g. living-room/light/lamp) and emit output node-red events. The node also consumes input events and calls HomeCenter actions based on given input events.

Flow example

nodered ui sidebar tabs

[{"id":"81e3d6d5.cf8668","type":"home-center","z":"dfb9ceb.40e533","name":"HomeCenter 2","device":"","x":460,"y":100,"wires":[["6375721b.5dd3bc"],["54ad8d6d.220454"]]},{"id":"6375721b.5dd3bc","type":"debug","z":"dfb9ceb.40e533","name":"hc.event","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":700,"y":80,"wires":[]},{"id":"54ad8d6d.220454","type":"debug","z":"dfb9ceb.40e533","name":"hc.error","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":700,"y":120,"wires":[]},{"id":"6dbacab5.56a1a4","type":"inject","z":"dfb9ceb.40e533","name":"kitchen/lights/lamp : OFF","topic":"kitchen/lights/lamp","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":120,"wires":[["81e3d6d5.cf8668"]]},{"id":"5de166ca.8e9998","type":"inject","z":"dfb9ceb.40e533","name":"kitchen/lights/lamp : ON","topic":"kitchen/lights/lamp","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":80,"wires":[["81e3d6d5.cf8668"]]}]

Output event examples

Light has turned on:

{
    "topic": "garage/light/lamp",
    "id": 10,
    "property": "value",
    "payload": true,
    "previous": false
}

Temperature has changed:

{
    "topic": "living-room/climate/temperature",
    "id": 20,
    "property": "value",
    "payload": 22.7,
    "previous": 22.9
}

Device power consumption has changed:

{
    "topic": "living-room/climate/fan",
    "id": 30,
    "property": "power",
    "payload": 2.9,
    "previous": 2.7
}

Input event examples

Event message format:

{
    "topic": "device literal identifier",
    "payload": {
        "action1": [],
        "action2": [argument1],
        "action3": [argument1, argument2, ...]
    }
}

Turn on a light:

{
    "topic": "garage/light/lamp",
    "payload": {
        "turnOn": []
    }
}

Change RGB/W device color:

{
    "topic": "living-room/light/led-strip",
    "payload": {
        "setColor": [255, 0, 0, 0]
    }
}

Input message shortcuts

payload can be a boolean value, in this case it will be transformed into turnOn and turnOff actions.

A shortcut version of turning on a light (in case when a device has turnOn and turnOff actions), true calls turnOn and false calls turnOff action accordingly:

{
    "topic": "garage/light/lamp",
    "payload": true
}

In the case when payload is nether object nor boolean it will be transformed into setValue action.

A shortcut version of setting a brightness of an RGB/W or a dimmer device (in case when a device has setValue action):

{
    "topic": "living-room/light/led-strip",
    "payload": 50
}

In the case when an action has only one argument it can be passed without wrapping it into an array:

{
    "topic": "living-room/climate/thermostat",
    "payload": {
        "setFanMode": 2    
    } 
}

instead of:

{
    "topic": "living-room/climate/thermostat",
    "payload": {
        "setFanMode": [2]    
    } 
}

Errors handling

The second output allows handling error responses from HomeCenter and the node.

Introspecting

The information for introspecting the devices friendly names and all possible actions is available on the node context.

  1. Navigate to Context Data
  2. Select a HomeCenter node
  3. Click on Refresh
  4. Devices and their available actions grouped by rooms and categories can be introspected on the node context: nodered ui sidebar tabs