Thank you @rossko57
Your approach is similar to what initially I had in mind.
But @hilbrand idea about setting up parameters in rules and the to use actions seems good to me, because although is a little more complicated for the user is true that is more or less an advanced addon, and if the user can write queries in a native language is very probable to be able to write rules/scripts also.
But the approach of being able to combine simple queries on items and then being able to customize parameters on rules that offer exec binding it’s interesting.
Althought I don’t like the need to define custom items just for parameters and have two different rules for an execution (params + real one)
I have to think about that, I want to be able to work only on actions and a DB thing, but supporting item queries at least for parameterless ones seems a good idea. For parameter ones, I’m not sure if it’s simpler to just execute directly in an action.
My idea on actions is the more independent case they can simply calculate the result query and put the value in a manual item.
It’s more or less the way it works a script that I’ve to check inet speed that I copied from here a lot of time ago: Speedtest-cli Internet Up-/Downlink Measurement Integration