Hi there. Decided to create this topic, as I greatly impressed by capabilities, which Node-RED brought to my smart home when I migrated to it from OpenHAB Rules. It’s a kind of continuation of this topic.
Node-RED designed to provide connectivity for IoT world, therefore it’s like a competitor to OpenHAB in this sense, but I don’t propose to utilize it as connectivity tool - I think OpenHAB has a great value here, by having all those connectivity bindings. Instead I propose to use Node-RED as purely hardware-independent rules and scripting engine.
E.g Openhab works as a gateway to convert all possible protocols to (logical) MQTT protocol and vice-versa. And Node-RED uses these MQTT messages as inputs and outputs of the rules.
Just some example - following rule realizes motion-controlled light with darkness detection and brightness, controlled by luminance sensor.
All graphical. No programming, Java, Lua or Python.
But there are more nice features in Node-RED:
- Easiness of debugging. Just place inject and debug nodes anywhere in message flow, connect them, and you can easily simulate all functionality without any I/Os, by clicking on the squares near blue nodes - this will generate test messages and whole algorithm can be easily verified without any risk to destroy your boiler or disturbing your house-mates by moving rollershutters all day.
- HW Independency - as I/O interface for Node-RED is MQTT, designed in Node-RED rules can work with any type of sensors - Z-wave, KNX, Arduino and even not only Openhab but any Home Automation Software, which supports MQTT.
- Sharing - Node-Red provides simple JSON-based copy-paste functionality, so that everyone can share it’s algorithms. For example algorithm above is available here for immediate download.
- Stability - for 2 months of usage and after 4 deployed rules I had no problems with stability of Node-RED, or exception issues - it just works.
So I propose just to try it - the installation is easier than Openhab. I’m thinking of creating some tutorial, if anyone shows more interest, but typical steps are: install Node-RED, install MQTT Broker(Mosquitto, for example), install and setup MQTT event bus Binding in Openhab and you are done.
Adding Tutorial on Rules Creation