QNimbus / node-red-contrib-openhab-v2

MIT License
9 stars 3 forks source link

Output string from "in" node #23

Open dome2048 opened 3 years ago

dome2048 commented 3 years ago

I'm new to this version of the openHAB node, as this one has been updated to work with OH3 and the other one has not.

I'm having trouble getting my flows moved over to this version of the plugin, as it puts out a much more complex JSON output than the other plugin. I'm sure if I were more technically saavy it's a simple matter to extract the state from the JSON and turn it in to a string, but truth be told I spent almost two hours and couldn't figure it out. I have to imagine there will be more people coming to this version of the node as well, since the other version doesn't seem to be maintained anymore.

Even if I did understand how to do it properly, it would be nice for simplicity's sake if the "In" node could supply a second output with just a string so the output could be used directly by another node without some type of change node in between.

Attached are pictures of this node and the other one with the desired behavior (connected to openHAB 2.5.9).

Thanks for considering!

Screen Shot 2020-10-14 at 23 37 58 Screen Shot 2020-10-14 at 23 38 38

dome2048 commented 3 years ago

I was probably too tired to be trying to do this yesterday... I did figure out how to connect the nodes. For the benefit of anyone who comes after me, I used a change node and set the output to msg.payload.state.

I'm keeping the issue open as it still would be nice to have an option to output just the state without a change node.

I forgot to include this info yesterday: I'm running an Ubuntu 20.04.1 server version with nodeRED 1.1.3 in a Docker container ( as is openHAB).

QNimbus commented 3 years ago

@dome2048 You just beat me to it, but that is indeed the way to access the 'state'.

I will mark this issue as a feature request though, thanks for your support!

dome2048 commented 3 years ago

Absolutely, thanks for your work on this plugin! So far it looks great!