In use by bug

Simple to reproduce:

  1. New rule
  2. Add On switch action, select one device, save action
  3. Add Off switch action, select one device, save action
  4. Delete first action, save rule, exit rule editor

Now if you view rule settings you will see that both devices are present and they will each show as being is use by this rule.

I don't think it has anything to do with cloning. When cloning you always need to edit rules and the editing is where the devices are not being cleaned up.

I suspect it would disappear if you took Bruce's advice and removed the device first, then deleted the action. I know this isn't ideal, but settings in Hubitat's current app model get messy quickly for complex apps like RM (not sure if you've ever tried to write a Groovy SmartApp in ST or an app on HE--very similar model), so this is probably the best users who depend on this feature can hope for at the moment.

If there were an option on the Rule Machine main page to "wipe" the used by references, then we could update it as we open and save rules.

I don't think it's that simple--I'm guessing the spurious "In use by" devices are just ones that got saved as an app setting somewhere (including when an action is deleted without removing the device first), and if you erase all settings, what you've done is...started over creating a new rule, which you can already do to get rid of these references. (The work to weed out which settings point to devices would likely be possible but not worth their limited time and would land you with a bunch of broken actions, which are also not always fun to fix.)

Here's an idea: create a virtual device of each type you might want to use it in a rule and name it something that makes that apparent. Use that in your "parent" rule that you clone. Then, no matter what you do, the worst you'll get is the already-fake devices spuriously referenced as you go into each new child and switch it out for "real" devices. (I think you can avoid this problem in non-cloned rules by working backwards any time you want to change or remove an action: de-select the devices first, then the action, etc.) If you've seen any example rules I've posted for people, this is usually what I do, which is why all those devices have weird names. :slight_smile:

I also just ran into the "in use" bug. I did clone the rule and removed a device that is still showing as "in use" when it is not.

I am new to Hubitat and noticed a device switched off unexpectedly. I think i found my device issue but the "in use" bug made it very confusing to find the cause. Is there any progress on a patch for this?

By the way, the Hubitat is awesome, from the community to the creators and workers. I'm binge watching, "Hubitat Live" and slowly migrating from the Vera Plus.

Hi, the REAL problem with this bug, ir when you clone a rule is copy the In use by.
So it is realy bay becuase you istar a Clone rule with dives that will never be there.
Thanks, I hope you get it done this year.
thanks.

It's been a year since discussion, has this situation been resolved? I am still having this in many devices...

1 Like

yes i am also experiencing this.

As is everyone. :slight_smile:

Hasn't been addressed yet. Not sure when, or if, it will either.