Node-RED as Alternative Rule Engine

Will Node-Red also be part of OH3, or will this rule engine not be usable anymore?

1 Like

I’ve only got a tiny part of my test rig transferred, but so far so good…

2 Likes

NodeRED isn’t part of openHAB. It’s installed with openHABian if you use it, but it’s distinct software. NodeRED relies on an openHAB plugin to communicate.

I haven’t tried the current plugin with openHAB 3, but even if it doesn’t work yet I’d be shocked if the developers didn’t update it.

Even if they didn’t, there’s other options, like exposing the items you want to control to MQTT and then connectI’m nodeRED to MQTT.

Thanks. Hoping for the best…

Hello all,
I am running OH 2.5 on Raspberry Pi and for a long time I created my automation in code.
Just installed Node Red and it looks very interesting.

My problem now is that i can’t seem to get the nodes to respond to updates of the items they are connected to…
Couldn’t find any entry in the forum on that subject.

Sorry for pasting the actual code, I’m away from my computer…

So my example is pretty strate forward.
I have a switch item defined in an items file, not connected to any channel (ie a dummy switch) and it’s just visible in basic UI for interaction.
In Node Red i defined the openhab config node and i guess it’s connected correctly because when i added “openhab in” node i could see all my items including the above summy switch.
I connected the first port to a debug msg node, and that’s it.

After hitting “deploy” i can see that the status of the item gets updated (OFF for instance) and the correct message appears on the debug console (“OFF”).

But after that when I change the status of that dummy switch from basic UI (turning it ON) nothing happens in node res and i don’t see the item’s status updated (stays OFF) and obviously i don’t get a new message in thw console.

The same thing happens with other items- when deploying the flow the status is updated but it doesn’t seem to respond to changes after that.

Has anyone encountered this problem?

By the way- in the openhab controller i didn’t enter any username or password. But even when i entered “openhabian” and my password it didn’t change a thing.

Am I missing something?

Thank you guys a lot…

I am no expert, but in OH3, there are API tokens preferred, not username/password.

Do you have both versions of the openHAB node installed? That caused issues for me.

No, i have only one version installed…

node-red-contrib-openhab2
Version 1.1.8

I had after openhab3 migration problems with the openhab2-get node. As @Tobi77 allready mentioned the API token solved the issue.

Just wanted to point out that I’m still running OH 2.5…
So all the OH 3 problems is not yet relevant in my case.
And after few more days of trying, still the same problem- the openahb in node doesn’t respond to updates of my items.

Any ideas? Has anyone faced that kind of behavior?

Thanks…

For OH 2.5 no username/password is required.

What did you define for your host and port?

As for a way to test add the openhab2-events node to your work space and a debug node, update the event node with your OH controller name, and update the debug to complete msg object. If your console log doesn’t show anything after a few seconds you have a connectivity issue, if you see logs then there is an issue with your test item.

Thank you for the tip…

Apparently it’s a connectivity issue because i don’t see any events.
I defined the host as my pi’s ip address (192.168.x.x), the port is 8080.

But it’s strange because when I add a node I can see all my OH items. If the controller isn’t connected I shouldn’t be able to see those, should I?

Another test I did- I installed another package of nodes called “node-red-contrib-openhab-v2” (ver 2.0.3) as opposed to “node-red-contrib-openhab2” (ver 1.1.8).
I couldn’t find in the documentations if one of these is deprecated and the other is the new one.
In this package there are less nodes, there isn’t the “monitor” and “event” nodes, but after I defined the controller (with the same details) and added a node with the test switch I described earlier- it’s responding to changes.

Does anyone know that’s the difference between the two packages? which of them is the most recent one? Is one of them the updated version of the other?

Thanks

I did not play around with manual installation but used OpenHABian and openhabian-config (optional components) to let the installer choose the right download.

Well after a LOT of tests and tries I couldn’t get it to work no matter what.
It’s not that I’m an expert developer so there must be something I missed but I decided to let it go for now.

I’m ordered a new Pi and planing to install OH 3 from scratch and give it another try.

Thanks for all the rsponses.

They are both being actively updated, though only the one with green nodes is currently working on openHAB 3. There’s been work on the other one but it’s not there yet. Sorry I’m on mobile and don’t have the package names in front of me.

Other users (and me) are reporting issues with having both installed, so if you are using both try removing one from your pallet and restarting.

Edit: whoops, I already gave you that advice. I thought that was a different thread…

Hello,
Just an update- after installing a new RPi with OH3 and Node-Red, I can say that everything is working smoothly.
I did everything EXACTLY as I did before with my OH2.5 installation only this time the green nodes are reacting the way I expected them.

I have no new insights about the reasons it’s not working on my OH2.5 but if I’m the only one it happened to, than I guess it’s something I did along the way to my installation.

So for me, so far, Node-Red is working great in OH3. :grinning:

After installing nodered via openhabian, how do I connect it to mqtt/mosquitto?

I’m not at my pc and don’t remember the exact definitions but the gist is-
After adding an MQTT node, double click to configure, and under server choose to define a new broker.
There put the ip, port (if changed) username and password if needed.

Hi

Im trying NodeRed for the first time, I can read an items state using the openhab2-in node and understand I need a switch node to read that items state . The state will always be ON, so i need to read state unchanged.

My switch node has ==ItemStateEvent but its not clear to me whats required next.

The first topic in this thread says the the bottom channel of the in node, but my openhab2-in only has a single channel.

The goal is I want the ON state to then work with a msg.payload when sends some data to an RFID Card reader. The card reader side is all working, its just I cant work out how to link OH and the ON to trigger the flow

Thanks!

Hi,
with OH3 we got alternative rule engines like JS/Blockly.
Can somebody of OH foundation or whoelse can explain me, why blockly got prefered over node red IN OH3 as a default rule engine? I just see one, maybe two reasons:

  • blockly is used by other home automation software and OH
  • blockly might be easier to integrate (but a node red integration were already partly available in OH2)

IMO / fact is:

  • in business / professional area BPM (business process model) subjectly and technically is way more common / blockly is nowhere used there
  • blockly is looking way more complicate in the beginning, because it looks more difficult to see, where to start and end with compared to a BPM where you easily signals a start and end point

In all professional solutions where we talk about low/no code, BPM is there and blockly is not even mention tbh - IMO for a good reason.

1 Like