pdmangel / node-red-contrib-openhab2

Other
21 stars 15 forks source link

Input node with more advanced features. #25

Closed jeroenhe closed 6 years ago

jeroenhe commented 6 years ago

I’m using your plugin for quite some time now and it works very well. However, since I started to migrate most of my rules from openhab rule system to NodeRED, I’ve come across a change for the input node that helped me a lot to keep my NodeRED flows clear. I have quite some situations where my original rule consist of a situation where I like to react on a change in sensor state only (“changed from OPEN to CLOSED”). With your Input node I would have to add quite some switch and change blocks to accomplish this. That’s why I’ve created a new input block that helps you omit these required blocks.

I was wondering if you, or anyone else who is using this great plugin would be interested to see this input node added to your plugin. If so, I would like to discuss in what way it would be appropriate and I can of course create a more specific PR that is better suited.

So te be clear. With your input node, if I’d like to monitor for a change, it looks like this:

screen shot 2018-03-02 at 08 25 34

with my version, it's just the single node:

screen shot 2018-03-02 at 08 28 21

and it's configuration screen currently looks like this:

screen shot 2018-03-02 at 08 36 17

Let me know.

raufis27 commented 6 years ago

Looks useful!

fab33 commented 6 years ago

It's quite specific. Don't think it's a good idea to put this in this node (Keep it simple). To re-use your example you can create a subflow (or use action node).

jeroenhe commented 6 years ago

It's quite specific. Don't think it's a good idea to put this in this node (Keep it simple). To re-use your example you can create a subflow (or use action node).

That's an alternative pattern I hadn't thought of, thank you for pointing that out. And I agree keeping it simple is very important. However, for my workflows the "advanced" input node still seems to make sense after playing around with subflows, but YMMV of course.

pdmangel commented 6 years ago

I always wanted to keep the different nodes as simple as possible and refrained from adding a lot of options which can be wired in easily. Channel 1 already outputs only changes, so no need for the 'Item Changed' node.