Blockly - Group members


I’m currently trying to move my rules from an old OH2 setup to a new OH3 install and thought I’d try to use everything UI and Blockly.

Things are going well so far but I have come into an issue with Blockly and groups.

I know in DSL you can code it so that do something when a member of a group changes / updates etc and you can then get which particular member to use it in the next part of the rule.

I can’t seem to find this option in Blockly, there is a ‘get members of group’ but that just does the first part of the DSL coding, what I really need is for it to them tell me which one changed so I can do something to it…

Anyone any ideas? What am I missing?

You’re looking for the contextual info block under openHAB → Run & Process:


1 Like

Awesome, thanks…onwards with Blockly!

So, if I assume this correctly.

I have a trigger ‘When a member of of my group changed’ it then runs the Blockly script:

I set a temp variable to ‘contextual info (triggering item name)’

Which I believe should give me the name of the triggering item from the group…

Only it doesn’t…I get in the logs:

“event” is not defined in at line number 28

Which is vTempUpdatedMember = event.itemName;

So, I’m missing a step I think???

Are you testing the blockly action by pressing the play button? The event object is only injected into a rule when it is actually run by one of the triggers.

Doh :roll_eyes:.

It’s been a long day! Thanks…

1 Like