Not sure, if I understand your problem. Instead of linking your GUI widget to a particular item you can start a rule and provide parameters to that rule. In this case it would be the item’s name and command you want to control (e.g. itemName, itemCommand).
In your rule you define that parameter in the props section which you can now access under props.itemName.
This way you can send commands from a rule to items in a generic way
Thank you for your help…
I understand that it is a bit confusing.
I have a switch which is called 75% open.
If i turn on this switch the rule it checks the positions of the blind item and then puts it to 75%. The positioning of the flaps is different if coming from above or below thats why it needs to check the position. To have the flaps open it first needs to be greater than 75% and then set to 75%.
The rule itself works.
I just need help with triggering the rule with different switches and then using different items.
If triggered by switch 1 use blind 2
if triggered by switch 2 use blind 2
This is exactly the sort of use case where I employ custom metadata. All of my remote switches and buttons use one generic rule (and they are as @djal suggested members of one group so that the rule trigger is simply Member of group changed).
The rule then gets the appropriate metadata from the item that triggered the rule and that metadata sets the target item to command and the command that is sent based on the command that triggered the rule.
For example, here’s the metadata for a switch in my living room that can support up and down short, long, and double presses (which each result in the state being changed to some number):
config:
"1.0":
command: ON
device: Outlet_LivingRoomLamp_OnOff
"1.1":
command: ON
device: Switch_LivingRoomLight_OnOff
"2.0":
command: OFF
device: Outlet_LivingRoomLamp_OnOff
"2.1":
command: OFF
device: Switch_LivingRoomLight_OnOff
"1.3":
command: ON
device: Switch_FrontHallLight_OnOff
"2.3":
command: OFF
device: Switch_FrontHallLight_OnOff
So if that switch receives an up long press, it triggers the rule with a state change to 1.1. The rule accesses the metadata, looks up state 1.1 and has the information to send an ON command to the living room light.
Adding a new remote control to the system is a simply as adding the remote’s state Item to the group and configuring the metadata for it.