Export all rules as text based

Planning ahead...

I'm looking at moving home and likely to start all my rules again from scratch, partly due to different layout and also so all my rules are cleaned up plus moved to latest rule machine..

Is there a way to export legacy rule machine (4) for me to reference when re doing my rules. I don't want to import ideally.

1 Like

Screen snapshot?

1 Like

Thanks for the idea. Problem with that is I have what feels like hundreds of rules so that's a little slow.. but I guess I could target more complex rules.

honestly, i would suggest writing down the general idea for the rule(s), then seeing what you can construct now that you have more experience. a lot of times, we create rules then bandaid on top of them to make it work. top this off with the evolution of rule machine as well, or the inclusion of basic rules, and it might be beneficial to just remove the confirmation bias of the previous rule and just look to create a new rule with your end goal in mind

2 Likes

You could export, then re import temporarily pause them and then create the rules in 5.1 (or just pause them now and then recreate then delete the old ones as you create the new ones)

3 Likes

Sure. Agree with rewriting. Also the import and pause rules then delete once they are all replicated.

1 Like

I would love to be able to export all current rules as text to be able to search them, either for specific devices or for certain techniques that I've learned better ways of doing.

You can do that in the app settings screen for RM by clicking the cog icon and using the export option in that screen. Not sure if you can do them in bulk...

1 Like

Seems you can export from the legacy rule machine and rule machine via the cog as @sburke781 said. I chose the top app called rule machine legacy I think and it seems all rules were exported as json.. so that seems possible. Haven't explored it thoroughly but it appeared to export all rules. Just need to read it in a json viewer now.

1 Like

Notepad++ has a json formatting option if you wanted to use that.

1 Like

Great. I have that on my PC already so good news. Just been doing all this from mobile since seeing your Post

1 Like

Very interesting - thanks!

Informational only: this doesn't work on my exported 4.1 rules.

json

I tried it randomly on a few of my rules and the result was always the same.

I mean at that point, isn't it simply easier to pause old rule, open the old rule in new tab, start new rule in 5.1 and create new rule while looking at logic of old rule? When complete, delete old rule...Really it's the easiest way since you can't import rm4 rules into rm5

Sure is. I just wanted to try out something I didn't know existed because it could help me in developing my already in place rules instead of using the IMO cludgy interface and it failed, so I thought I'd update the thread.

1 Like

I get the same error with the JSON Viewer, not sure exactly why, but I can see the tree view panel on the left (after the error shows up). Looking at that, I'm not sure how easy it may be to understand how the rule is constructed. Probably best to import the rule onto a hub and look at it using the RM app.

Certainly text searches for references to devices or common "things" used in rules would be possible, even without the formatting. But the main reason I suggested the JSON viewer was to be able to scan through the JSON visually, which I'm not sure would be as useful as I thought... But I could be wrong... In the end it is not the main intention of this export / import feature.

1 Like

An example of this is i updated package via package manager and lost some devices. Since that time i created some rules. I had to go back to a backup, see the variables that i lost/dropped, go back to current and implement those devices again. This case was RM, but it could at times be in other apps.

It'd be great to export all rules to text to search those items easily. I believe above examples are being able to export one rule at a time?

I think I managed to export rule machine itself and all rules went into the json.. But I haven't moved yet so haven't looked into it any more