Cloned Rule: incorrect in-use-by

Hi,

Hubitat 2.1.2.123 Rule machine 4

Created rule to notify when device "my phone" was home.

Cloned rule, renamed "wife phone" and edited device from my phone to be "wife phone"

Both rules work as expected.

However, looking at device details of "my phone" it is listed as in-use-by BOTH notify rules (wife and my phone)

Wife phone is only in-use-by wife phone notify rule.

Looked at details of "settings" for wife phone rule and my phone is listed as i rDev1 capability ????

Seems like cloning/editing not working as I would expect.

Do you have your old phone still listed under ā€œConditionsā€ within the new rule? You can go to ā€œManage Conditionsā€ and delete the old phone if it is not used by the rule anymore. That will also take card of the In Use By within the device

Thanks for reply

No, my phone was unselected and wife phone selected in Rule making template.

Rule is

Trigger presence wife phone arrives

Action to run speak on google home ā€œwife is homeā€

No ā€œmy phoneā€ visible anywhere in rule view or trigger view (only wife phone)

Only in ā€œsettingsā€ view does wife rule show my phone, not wife phone as I would expect

Something is not right

Re edited rule

Forced unselect wife phone then reselect wife phone then save
Then exit trigger then force update rule.

Only shows wife phone in rule view

STILL shows my phone in settings view and in-use-by

I bet a brand new rule for wife phone would just show wife phone, problem was this rule was cloned from my phone and canā€™t seem to get switched to wife phone

This is harmless except that you're bothered by it. When you deselect a device in a rule, it doesn't delete the corresponding setting. That's why you still see your phone in the wife rule settings. That setting then shows up in the In Use By list.

In and of itself, this has nothing to do with cloning. It has to do with deselecting a device in a rule and that not removing a setting.

Seems like sloppy syntax editing to me

It's not related to syntax editing. It has to do with how deselection of things is handled. While it would be theoretically possible to keep track of every selection made in a rule, and then diligently go through and remove all settings related to the object that was deselected, this would be a huge undertaking affecting hundreds of lines of code. This in turn would directly affect the efficiency of the app, as it has to load every time it runs. And all of this effort for what? The cosmetics of the settings in app settings and In Use By? It is purely cosmetic, and has no impact on how your system works. 'Fixing' it would have a negative impact on how your system works.

5 Likes

Is there a workaround for manually removing old device settings from cloned rules?

I use the "In Use By" to help me find what's making a device misbehave. I've been going a little rule crazy.

Thank you!

hey @bravenel I have found now as well this problem. When I clone a rule and then I change the devices used in this new cloned rule to new devices it looks like the original devices are still attached to the new cloned rule although they have been removed. Will there be a fix for it?

Did you see this post?

1 Like

yes but the in-use-by shows incorrect data as shows rules that are actually not linked to a device. I have had to migrate devices so I use the in-use-by to replace the device where needed in my rules but with this inaccurate data is hard to know exactly then where there are used.

If the devices are not in the actions (or the trigger for that rule), they aren't used by the rule.

So I simply check each app in the in-use-by section before deleting the device (as an example).

If you clone a rule, and deselect a device in the cloned rule, so as to replace it with a different device, it will no longer show in the in-use section for the original device. If, on the other hand, you delete the trigger, action or condition without deselecting the device, it will still show in the in-use section, and will in effect be stranded as such (unless the rule is removed). Incidentally, this has nothing to do with a cloned rule, and is true for any rule, and for any app. While you can delete a portion of an app within which there is a reference to a device, without deselecting the device, that leaves the device connected to that app. Again, deselect the device first.

As discussed in the linked post above, this behavior would be very difficult to change, and can be completely avoided by deselection of devices (if this issue matters to you).

Also, if you do delete a portion of an app with a still selected device selection, thus leaving the app in the in-use section for the device, often you can recover from this by re-adding in the same portion of the rule you just deleted. In many apps, the original device selection will still be there, and when so, the device can be deselected. This won't always work. If you end up with an app that is erroneously listed as in-use by some device, the only remaining method to deal with that situation is to remove the offending app.

ok, I will then always first deselect the device to make sure will work correctly, thanks for the advise

Also, know that the in-use portion of a device page is static. Refresh the page to see the latest.