Make Rules more Flexible Would be Nice if

A Variable range clipper action in a rule. e.g.

I make not be understanding this one but, as in it may already be implemented in another way

  1. Could we have a for loop in a rule?

  2. JSON notation in rules e.g.


    Of course, we would need a JSON variable type
    I can't be the only user who has Arduino devices on MQTT sending JSON

  3. What about a MAP function like Arduino very handy e.g.

I really like what you guys have done with the product, particularly it seems to be much faster since the last update. I started my home automation in Node-Red and wanted a higher level system. Hubitat does that well.

1 Like

Loops are the repeats. And you can set up a repeat to repeat the actions a certain number of times. That's basically a for loop, they even call it that in the documentation.

1 Like

you could do this with a repeat, a local variable, and multiple if statments

local variable = 1
Repeat 5 times
IF local variable = 1 THEN A
IF local variable = 2 THEN B
IF local variable = 3 THEN C
IF local variable = 4 THEN D
IF local variable = 5 THEN E
local variable +1
END REP

1 Like

definitely not trying to start an argument, just wanted to offer my take on the solution since you did ask if it was possible

as a person who did coding while in school, i definitely agree a FOR loop would be helpful, but being exposed to different things through my career, it has also helped me think different when approaching different problems

in regards to RM, it might be a limitation of the backend. typically when i come across that, i just find some way to make it work and test the hell out of it while i'm building it (lead to about 20 revisions to a rule i use to control my blinds)

there are alternatives though if RM isn't a viable option for you (i personally don't use them, but doesn't hurt to check out). i've seen others mention using Node Red or WebCore

While I do see the screenshots of the rule in your original post, could you explain a bit more as to what you're trying to achieve? Maybe we can come up with some alternatives while staff hopefully expands the capabilities of RM

2 Likes