Node red rules TriggeringItem

Hi I’m fairly new to Openhab rules. I have a few running and it’s been a steep learning curve but worthwhile.

I have recently discovered Node Red and I like the speed with which I can set up rules without spending too long desperately trying to get my syntax right. There are a few useful nodes that others have developed too that have more functionality than the rules DSL an have made my life simpler. So I have decided to use Node Red as my primary platform if… I can.

But there is one area where I think I am going to have a problem. I am planning a more complex rule where I want to use a rule on a number of grouped items. I want to be able to add items to that group without having to rewrite or rewire my rules so I need to be able to use an equivalent to Triggering Item to identify which member of the group is responsible for triggering the rule.

So far I haven’t found a way to do this. I can pick up when a group changes state but the node red nodes don’t seem to contain the Triggeing Item information in the message payload. I could cycle through the members of the group but if I’m just looking for a state change (which might be On to Off or Off to On) then I can’t distinguish the right item from the rest. I could have a bunch of item nodes feeding into one flow but then I can’t add an item without changing the flow too.

Does anyone have any ideas?.. or is there a workaround?.. or is it possible to add this functionality to a group node?

I have the same situation - I wanted to switch to node-red as the rule engine, but a lot of my current rules use the triggeringItem.

So to push the question up - is there a workaround or planned solution?

1 Like

Strangely enough, I was / am looking for something like this too.

Because I need to get the value of another Item, from a different group that has an almost identical name, as the triggeringItem.

My use case

A group of Alarm minutes.

When a member of the minutes group passes minute 59, it needs resetting to 0 and the corresponding Hour Item needs increasing

And an equivalent effect when the minutes drop below 0

I’ve nearly done it in DSL, except I can’t seem to be able to get the Hour value from the compiled Hour Item name, because it has become a string.

My thoughts were to do something similar in Node-RED, but as with everyone else, I can’t pick out the triggeringItem

Thanks, your guidance has saved the day again