We all know everything breaks, just how do I make a backup of my SmartThings Hub programming?

Events? Did I sleep thru some kind of tectonic issue?

Multiple people reporting that all their devices, including their hub, have been deleted from their account, along with all of their rules and routines. Even though some of things still showed up in the IDE.

It has been acknowledged as a known issue caused by a platform operation, but with no available, helpful resolution other than rebuilding everything from scratch. And even then some people are saying that they are not able to rebuild. :scream:

It’s not everybody but it’s more than just a handful. Acknowledged on the official status page now.

The status page says they will give affected users instructions on how to restore functionality, but so far the instructions have been to rebuild from scratch. :disappointed_relieved:

This is the email that some affected users received this morning:

1 Like

Yikes! Making me think very hard about Hubitat or HA!

I’ve lost the best part of a day from the timeline. It was very early morning in the UK when the first dropped b******* were being discovered and I had to wait hours for the next reports.

1 Like

Exactly this.

And yes, this did seem inevitable. I moved away from Routines completely because of the lack of backup capability. The automations I have on SmartThings are all rule-based, except for my scenes (for which I maintain screenshots for reference). My rules are all backed up in Postman, and I can update device IDs throughout them all by simply modifying the appropriate variable(s) in the event a device fails or is inadvertently or even purposely removed. Having an equivalent capability with Scenes would make me very happy.

My more complex SmartThings automations continue to run on webCoRE on HE, and those are backed up along with my hub. (HE also has a convenient tool for swapping devices with apps). I have mixed opinions about both platforms, but HE’s backup capability is undoubtedly superior…because there is one.

1 Like

If anyone isn’t following this:

Rules live on the https://api.smartthings.com/rules endpoint where the mobile apps keep their grubby paws off them, and they aren’t messed around with when devices are deleted. They only care if a device ID is invalid when they are created or updated.

Routines live on the https://client.smartthings.com/rules endpoint and are the plaything of the mobile apps. The developer documentation and the API Reference don’t even acknowledge they exist. They are actually Rules with some extra metadata to help with the presentation. When you edit a Routine it is converted from and back to a Rule and that is why they can get a bit confused by out of spec devices and can’t cope with deleted devices.

Scenes, on the other hand have a foot in both camps. They are acknowledged in the developer documentation and API Reference as types of automations alongside Rules and they appear on the https://api.smartthings.com/scenes endpoint. They are Rules without conditional statements. All great so far, but they are actually managed by the mobile apps in a similar way to Routines and carry extra metadata. So they can’t be managed in the same way Rules are. It doesn’t really make a lot of sense. If there was a way to execute a Rule in the same way a Scene is executed they wouldn’t even need to be a thing outside of the mobile apps.

7 Likes

Great explanation!

Can you elaborate on how one would use “Rules”, rather than Scenes and Routines?

Rules are submitted via the ST API. You write Rules in JSON format and then submit them via the API. There are numerous ways to submit your Rules including tools like Postman.

The easiest way is to use the API Browser+ from @TAustin. It is a web-based interface that allows you to manage the full lifecycle of your Rules including the ability to Execute them. There is also a link to the API Reference documentation that shows you the available options and syntax.

3 Likes

Here’s a general explainer on Rules to get you started.

It should be noted that portions of that discussion are slightly outdated or ignore new options, like the powerful API Browser+ that Bruce mentioned.

Rules can be written in YAML and submitted via the SmartThings CLI (command line interface) , or in JSON and submitted to the API. I personally prefer the Postman/JSON route if only because of my familiarity with both from so many past projects, although I admit that YAML can be easier to grasp, especially with more complex rules.

The whole process can look a bit intimidating at first glance, but there are lots of examples and some incredibly knowledgeable people here in the community that can help when needed.

2 Likes

Sorry to resurrect this but is it possible to copy these to like a text file or something readable? I’m moving to Hubitat and having the routines clearly laid out I’d be happy to copy them over to Hubitat this rather than trying to remember them all, which would be impossible.

1 Like

look at the Advanced Web App and go to the Rules section… there are two ways to view them → Rule View or JSON VIEW

3 Likes