Handle Multiple Devices in One Rule [SOLVED]

Hi all

I am fairly new to Hubitat and Rule Machine. I have many dimmers in the house, and very annoyingly the cleaners and my wife still cant figure out how to turn them off - instead they dim them right down low, but not all the way off. So I'm trying to create a rule that monitors ALL of these dimmers, and if any one of them is set to a certain level (say below 10%), the following actions should happen:

  1. Wait 10 seconds
  2. If that triggering dimmer's switch is still on and still below 10%, set its level to 100%, then turn it off, then send me a notification

This is easy enough to do for a single device, but I'd like just one rule to handle all the devices, if possible. Is that possible?

Thanks.

It's possible but I expect the outcome wouldn't be what you would want. The is no advantage for having one rule and for this use case a per device rule would be best. You only need to create the 1st rule then export it and import that export. That way each time you import it you just select the new dimmer and save the name and it will create a new rule for you with a different dimmer.

3 Likes

Could I use a local variable? When the rule is triggered, save the triggering device as a variable and check the status of that variable’s dimmer and switch after the 10 second wait?

You can't save a device as a variable, only attribute values as there velevent types. But the issue would be what if a 2nd device triggered, the rule starts again and you now have 2 "versions" of the rule running. This will cause a issue because your still "running" the rule from the 1st device.

Just clone the rule. Much easier.

Yeah I wondered about that. RM isn't capable of running multiple instances of the rule simultaneously? If not, I guess I'll just need to clone it.

Thanks all.

Or do it in webcore. It has a reference to "Event Device". One piston should do the trick.

I tried it in Webcore previously and couldn't get it to work with multiple instances of the rule running simultaneously. Was hoping RM would be able to handle. No worries. Thanks.

Weird. Running multiple parallel instances of the same piston what webcore is good at. The trick is to understand how it triggers and parallelizes it's execution and include the right settings in the header properties of the piston. It's not a friendly excercise to go through though. Oh well.

1 Like

Doesn't that only copy over the devices so doesn't give you a option to change them? Not tryed clone for a while, that's what it used to do.