I build item comparable groups with same items like string, switch, shutter etc. (item_grp_1, item_gpr_2, etc.) and in the page I use only the standard widget to view all items in this groups.
One of this item (like string) start a rule (DSL/Javascript) if the user pushed on this item. Now I need to identify the item or the group item within this rule.
But: I did not know the item name, which is pushed from user!
There’s no way to directly send a value to rule that you call with the UI. Fortunately, there is a very simple workaround. You just need a single proxy string item. When the UI component is triggered, you don’t want to use the rule action, you want to use the command action to set the value of your proxy item to the full name of the real item you want utilize. Then you just need to set your rule to run when that proxy item changes and process the string in the proxy item however you need to get item name and group information. You can see a similar example here: OH3 Widget: Dynamic Favorites Bar.
Dear, thanks for your support - Now i have a Solution with two Proxy Items, like JustinG.
The idea from HFM did not work … sorry
But I think it must go easier?!
First i have a address number item in UI and with this number i am look within XML file for an eMail address and send an eMail via JavaScript.
Therefore i am using a rule with dsl and JavaScript: First dsl-Rule select via Command Action the address number (First Proxy) and via xpath transform in XML file i am save the email address in the Second Proxy item;
in the JavaScript rule i am using the eMail Proxy item and send an eMail…,