Is it possible to use the same PID define inside a rule for any “thing”. Let’s say I defined the PID parameters, and I wanna keep using it without the need to define a new rule for each “thing” each time, or simply by using the same PID controller again after I configured it the first time.
I was thinking I could use one rule and add actions for each newly device added in it, but I don’t think it is a good practice to use one rule for all “things” which could reach a count of 100 or more.
I think there needs to be more details given for us to give a good answer.
By PID are you referring to PID Controller Automation - Automation | openHAB or do you have an actual external device or software that implements the PID? Or have you implemented something yourself?
What rules language?
File based rules or managed rules?
You put Thing in quotes. Does that mean you are actually referring to OH Things? (Note that the add-on I linked to above operates on Items, not Things).
Do your rules for each new “thing” need to do something different?
If I understand, you have multiple things you want to control based on the same PID trigger.
In file based rules you can define the rule trigger as a global variable. Triggers are just a JS Object and can be defined outside of the context of a JSRule.
In the UI you can click on the Code tab and copy the configured trigger and paste that into the code tab of another rule. But the triggers will remain separate.
Open the rule with the configured PID trigger.
Click the Code tab.
Copy the PID trigger.
Open/create the second rule you want to use the same trigger.
Open the Code tab.
Paste the contents of the clipboard.