Nodered error after moving to openHAB3

To be sure you may want to systemctl stop nodered

As a nodered contributor/ dev myself I just want to clarify this is not true at all. Those a very different tools. Blockly is putting together JavaScript Code blocks in a graphical way, no more and no less. Nodered is actually a whole eco system of its own based around integrations of thousands of different things connectable in a low code way based on javascript / node.js and that is not unlike the openhab binding model. There is also a Blockly contrib in nodered itself actually.

That is unfortunately the only way right now as none of the openhab nodered nodes have been updated yet fo be compatible with the new authentication of the rest api. Most probably this will happen soon though.

Hopefully you’ll come back to it one day. Its a very powerful tool with one of the nicest most helpful communities surrounding it.

If you really want to delete it you would also have to uninstall it via npm.

1 Like

I may later, once I get my head around OH3 and work out a few issues. My last experience with it was shortly after I first started with OH2. It was interesting, but learning OH itself was all consuming at the time. :slight_smile:

Sorry I just knew they are both graphical ways of expressing rules.

1 Like

@JGKK
Set Basis Auth for the API fixed the issue for openhab2-in nodes. So I’m receiving values from OH3 properly. But I still have problems sending commands with openhab2-out nodes🤔.
Any ideas how to fix it? I’m strongly depend on my node-red rules but also don’t want downgrade back to oh2.

Best open a github issue on the github page of the openhab nodes so that the node authors can look at this.
I actually left openhab with the move to openhab3 and migrated everything to nodered so I can’t have a look myself.

Update to node-red-contrib-openhab2 1.1.8 did the job.:grin:

3 Likes

Was kind of shocked that it it not work out of the box.
This hint solved my day.
I am a heavy user of the combination openhab, nodered together with piVCUU; all on one rpi
openhab together with nodered is a great combination.

I’m also a heavy openhab/node-red user. I’ve migrated all my oh-rules to node-red.
But since openhab3 migration the openhab2-get node becomes very slow. It takes ca. 2sec to get values from openhab3. So even short rules may take up 10sec to execute. Bad for e.g. motion detection.

I’ve created an issue on git:

I would be glad to get some hints for a solution here.

found the right hint here. Now node-red runs again like a charm. :partying_face:

for me, I’m seeing
Unauthorized API request: Invalid Basic authentication credentials
each time nodered does a request, but I have the data in nodered… I don’t get it. I did generate an api key and enable basic auth

@Nodiaque: Use api token and basic auth. Update all palletes, restart nodered.service. After that everything works.

How do you use the api token?

How to generate an API token

Sign in to OpenHAB with your administrator username and password by clicking on the bottom left icon in your dashboard.

After signing in, click again on the profile button to access your profile page.
Click on Create new API token.

Use your admin username and password, fill in the token name (e.g. choose a name to remember the service you created the token for) and a Token Scope (optional)


Now the token is created. Please copy the full token now.
image
This token is in the used service your username, leave the password empty.
As example, below in NodeRed configuration the generated token is used as username.
image

1 Like

Hello, I have migrated to OH3 and I can’t get correct item state on NodeRed, sometimes is NULL and sometimes just stack on the state that it was when I started Nodered even I if change item state.
image
Although it can clearly read the items


I’m using API Token to connect and palette node-red-contrib-openhab3 1.3.4.
Where can I find logs about this?

Thanks

I am using node-red-contrib-openhab2 version 1.1.8 which is compatible with openHAB3. Version 1.1.7 is only compatible with openHAB2.5. The REST API changed from openHAB2 to openHAB3. This works on my setup when defining an access token in openHAB3.

You are using a different package, node-red-contrib-openhab3 which seems to be less maintained in time.

Hello Olivier,
Thanks for your reply, most probably there was something wrong with my nodered installation or setup. I delete the docker, setup everything from the beginning and it worked like a charm. Using node-red-contrib-openhab3 package.

I moved everything from node-red-contrib-openhab2 to node-red-contrib-openhab3 assuming this was the new version but according to @shutterfreak that one is less supported.

Which is the official one to use going forward ?

@lampy Could you give me a hint, how the “Token Scope” is used for?

Thanks

No clue, did filled it ones. Seems to be a kind of description, but since I don’t have to many tokens I only use the token name to separate two.