There's a small chance we'll be relocating for a new job opportunity this summer. While I realize that will obviously require starting fresh with a new setup, I'd love to somehow capture my various rule/automation builds to have as a future reference.
Like all of us here, there are many things over the years here that I've solved for in my own unique way, and I know many of those ideas would be helpful to utilize/reference in a new setup.
However, there's no way my memory is reliable enough to carry that load , and the thought of trying to screenshot everything and then organize all of that is daunting.
So far, my best idea is to swap in virtual devices as I exclude stuff prepping for the move, and then migrate a copy of that setup to my spare C8. Then I could later boot up that C8 to use as a reference, though it's unfortunate that its radios can't ever be fully disabled.
Has anyone else done "capture" prep like this for a move? Any other ideas are most welcome - thanks in advance!
YES! I too would like Hubitat to have some method to "save" Rules so that they can be reviewed (printed) at a later time. Ideally, save Rules in some common format that can be moved and printed.
To me it feels like, at the moment, this may be the best option. As much as exporting (in any format) existing rules and automations (which would need to include custom apps for many of us), seeing them as they are presented on-screen would aid significantly (I think) in being able to re-construct them on the new setup, including being able to export and re-import them on the new HE hub.
It would depend on your expectations here, but you can export any app in HE to a text file. I wouldn't expect it would satisfy most peoples idea of "printable", but it could be leveraged in some way to provide a more human readable form. My main concern would be trying to maintain this translation from the (JSON) output to the more easily consumed format, which different people would want presented in different ways, I expect.
You may also want to consider how much of your setup you will actually want to easily transfer... I would think that setting it up afresh would likely be where you would land, needing to use different devices to achieve a similar outcome due to a different layout or device options at the new home. e.g. How you control your lighting in the kitchen may be very different if the options for lighting triggers like doors opening or the positioning of sensors is different.
I realize very little (most likely zero) of current-vs-new will be end up being a 1:1 match; I have no illusions about that.
It's more just the "Oh yeah, I recall I had a neat trick for a similar XYZ condumdrum here-- now what the heck was that?" sort of thing... Again, that solution wouldn't likely be a 1:1 solve in the new place, but being able to review it would really help get me back in the right ballpark by leveraging my past experience (and not relearning via the hard way yet again) as I'm rebuilding.
Thank you for the reply. I don't want to export an "app". I want to preserve the "logic" of a Rule. Yeah, if I move to Home Assistant, I would not expect my Hubitat Rules to make much sense. And by the time Hubitat Rules is at version 9.0, I would also not expect my logic to make sense. And I am not looking for anything that can be directly imported back into Hubitat. I am just looking for a simple "description" of the Rule as it exists in the version of Rules in which it was written.
What were any Variables Created or Used.
What were the Inputs/triggers
What were the Conditions/Restraints/etc.
What were the Actions, including If Then Else
Seems like whatever Hubitat Rule version is used, there is a "logic" for how the Rule must be written. The "Export Rule Description" for that Rule Version should be able to easily be exported/printed out. Again, not expected it to be imported back into a Rule of any Version.
And Ideally, these "Rule Descriptions" would be stored within the Hubitat environment so that when I migrate from one Hub to another, those descriptions would would come over too.
I wonder if you're removing all the smart stuff? I seem to remember you did a lot of Z-wave LR replacement, so maybe yes.
Maybe you could just remove everything, replace the switches with dumb ones. Then, just bring the whole kit and caboodle with you, plug in the hub, and selectively install the switches and sensors.
Now that I type it though, it'd probably be easier taking a bunch of screenshots and starting from scratch.
If you were going to start from scratch though, would you have to exclude each and every device. Couldn't you just reset the radio and hub, and soft reset?
While I haven’t moved in over 20 years I have migrated my HE setup a few times in the past 7 years through various multi hub setup migrations to finally a 2 C8P setup.
My suggestion is to use a separate hub and restore the database backup. Those devices basically become virtual at that point since the matching radio device doesn’t exist. If you are concerned about the radios being active change the Zigbee channel to 26 or put your hub in a metal filing cabinet.
If you need an extra hub PM me as we can work something out with one of the many that I have collected.
Ha, yes, that is ultimately the crux here... Moving for this reason is a lot to ask, especially when you've long had a well-established house. The new gig would be my wife's - she's most definitely the breadwinner.
This is all a long way from a done-deal, and there's a good chance they won't be able to meet the salary/perks we'd want for the commitment of a cross-country move.
But I'm trying to start formulating some plans anyway -- better to be prepared!
Thanks very much for the offer! I do have a spare C8 I could use, so that's fortunate.
Assuming I exclude all devices (I'm planning to take most with me - I'd likely just leave a few Caesta switches behind), I'm thinking the "restore" plan will require a bit more work than simply restoring a regular backup...
I recall once excluding a Z16 I was using for my GDO (without first swapping in a virtual device), and I remember being pretty stunned at what a mess that left in my corresponding rules. Granted, that's a thornier parent/child device, but I'm thinking I'd want to sub in virtual devices to ensure the entire effort is most useful.
Right on. Although I'd perhaps try the "swap in virtual devices, capture/restore that backup" plan too, I too think the most sure-fire solution here is screenshots.
We're a macbook/ipad household, but I'll get a dock/hub that I can use to connect my macbook to my WFH monitors -- having big screens and a real mouse will help whipping through the captures.
I think I'll just start steadily chipping away at that here... Thanks!
Download a backup BEFORE you start excluding devices and use that to restore on your spare C8. Because you are right excluding the devices will delete the corresponding device record which mucks with the rules. Using a backup prior to the exclusion will be OK. The devices essentially become "virtual" devices. You might see errors in the log after restore as they try to connect and do things or apps attempt to control them but just ignore as you will still have access to view them and look at their rules.
This resembles the approach I'd take but I'd go a slightly different route depending on how many devices I needed to exclude. For me, it'd be a lot (over a 100) were I in your scenario. In that case:
take a local backup (no Z-Wave included)
factory reset the hub (under diags, advanced, full reset) // requires subscriptions be deactivated first
restore the local backup
You now have a fully functional and utterly pointless hub that does nothing whatsoever in the real world but is a 1:1 clone of your existing setup. Now you can begin steadily subbing the new devices (over time as you acquire/configure them) for their prior equivalent kicking your existing rules back into life.
Note, though, that having recently done something similar, albeit on a much smaller scale, I've found that some of the formerly-Z-Wave devices left intact after the non-cloud-backup/restore won't permit deletion--I've one such device lingering (disabled for now). I haven't tried deleting it with my Z-Stick yet because 1) it's not a ghost and 2) it's mostly just an annoyance in the face of my desire for anal levels or purity.
For months, I’ve been considering how to document the couple hundred rules and dozens of apps.
Instead of screenshots, I’m thinking about PDFing each rule, through a desktop browser. Open rule, print, save as PDF. I think that would capture the required expressions, triggers, actions, variables, and comments all in one go. Plan is to name the file the same as the rule. It would work for some apps, but not all. Some apps like homebridge would require a pdf per config section.
One benefit with pdf is search-ability. Which rule had that something or other, which I had made a comment for when I forget next year? (Let’s be realistic, next week.)