How do I search for commands within rules?

I am trying to unhook an old homeseer system that is still doing some work for me. Most of the connections are through JSON requests. So I would like to search through all rules and find these requests and remove them gracefully.

So far I have come up with this approach.

Click on Rule Manager
Click on cog
Click on export
Select all rules one by one
Export
Search through the export file for the http snippet

And if this is the best/only way to do it - when searching through this how do you connect the text snippet back to a specific rule. I ran some tests and looked for the specific IP - found them, but it wasn't immediately obvious which rule it was with as rule information seems to appear in multiple parts of this export file? Thanks.

How many rules are you referring to?

Are you using anything to format the export file on screen, to make it easier to read and see the overall structure? This may make it easier to locate your rules, albeit still a relatively manual search process. Apps like Notepad++ and others have plugins to help format common data files.

There are a couple of hundred rules.

I am using Visual Studio Code on the Mac to load it, but now you ask it is not formatting as JSON. I am used to Visual Studio doing this automatically and I started looking for a way to switch views - so far I haven't figured it out. It definitely does it (JSON editing in Visual Studio Code) and this would make things easier.

To answer my original question - this is the only way to do this? Thanks.

That didn't work - it is not auto recognizing the format as it apparently is not in any standard format. So while I can use this method to figure out how many rules actually have JSON calls in them it is proving difficult to connect them to actual rules.

I had the same thing in Notepad++, there must be some situations that produce text not able to be parsed by these tools. Shame...

I can't think of another way of finding the Homeseer calls...

This seems like a miss. As an installation gets increasing complex, being able to trace/search through the rules is pretty important. Logs only provide part of the story and even then only if you have them turned on.

And a quick update - trying to export all rules at once results in "an unexpected error has occurred". So I am going back to the old method of clicking through the rules that I think are relevant and checking them manually.

Maybe grasping here, but would using Rule Machine Manager to sort first help you out??

[Initial Release] Rule Machine Manager (New Rule Machine Interface) - :gear: Custom Apps and Drivers / Custom Apps - Hubitat

1 Like

Doesnā€™t help but thanks for suggesting this as I didnā€™t know about it. Anything to help with organization of rules is great

2 Likes