Updating SmartApps Without Reinstalling Sensors + Automatically Publishing from GitHub

Hi,

My company installs SmartThings devices for a large (> 100) number of clients, each with separate accounts, so before I publish our SmartApp to all of them I’d like to clarify exactly what happens if/when I need to make changes to it.

From developing and testing the SmartApp, I’ve noticed some changes clearly require me to reinstall individual sensors (for example, changes to preferences or the initialize function—which makes sense) and some changes seem to require me to actually delete and reinstall the SmartApp from the account. So far I’ve been doing this through the iOS app, although I’ll surely try using the Web UI for sensor installation when publishing the SmartApp to all of our accounts.

Is there any documentation on exactly what changes to SmartApps require reinstallation, either of sensors or of the SmartApp itself? Obviously I’d like to have anything of that nature as set in stone as possible before publishing everywhere.

On that note, I’m also wondering whether it’s possible to set accounts to automatically publish new commits from the linked GitHub repo? This would obviously be ideal as after initial setup we could make a certain subset of changes (exactly which I’m trying to find out now) to all accounts without even having to log in to each of them.

To be honest, I’m a bit unsure how GitHub integration is meant to work since, frankly, if often doesn’t. I suspect it’s throwing compile-time errors and failing silently vs. the JVM stack traces shown when saving an app in the SmartThings IDE. If that’s the only known issue with GitHub integration, I can simply use our test account to debug the SmartApp before committing.

So to recap: I’m wondering both what changes to SmartApps code require any form of reconfiguration other than just publishing it to an account as well as whether it’s possible to automate publishing new commits from linked GitHub repos. Any insight would be greatly appreciated.

Thanks!
Sophia Gold
Energy Technology Savings, Inc.

Hmm. That’s interesting.
When I have updated SmartApps or Device Handlers via GitHub or just copy and pasting over existing code, I have never had to delete a device or reinstall anything. They just keep on working.
Is it any particular one you are talking about?

Well, for example it seems obvious that changes to inputs in preferences would require reinstalling sensors, right? This may also be the case when I’ve modified event handlers and need to the sensors to be re-initialized to subscribe to them, but I’m not certain about that (it would seem some changes require this, e.g. names of the handler methods, and some don’t).

As for having to delete and reinstall the SmartApp, it would seem the only changes that could require this are in its definition.

I’d just like to clarify this precisely because any reconfiguration would be a relatively high human capital cost when maintaining this.

All I can say is what I have said above, I’ve never had to delete/re-install any device for any DH or SmartApp that I have updated.
I have opened a device in the ST app, updated the DH for a completely new/different one, come out of the device and gone back in and it changes with the new attributes/tiles that may be there.
For example I have some Fibaro motion sensors that I’ve tried various DH’s with from V2.0 to V3.2. Z-Wave to Z-Wave plus. I’ve never had to to anything with the device. They just work.
All I can say is that is my experience.

I’m confused because you mention having to go into the SmartThings app and change the Device Handler. I guess you’re saying you just write new Device Handlers instead of editing code in existing ones? And that they’re all agnostic to sensor capabilities so don’t need to maintain a list of inputs? In comparison, I’m using one SmartApp for multiple of each of four types of physical devices.

I just skimmed the topic about Github Integration for UK Users and saw mention of a CLI application for controlling the SmartThings IDE. Is there somewhere I can read more about that? I’m in the US, but this sounds like a great solution if automatically publishing commits to linked GitHub repos isn’t supported. I could just write a Makefile that loops through publishing to every account.

Sorry if I misled you.
What I meant was I look at the device in the ST app on my mobile.
If I then go into the IDE and change the device handler for that device, I do not have to delete/reinstall the device. It takes on the new DH used and the preferences and attributes.
For updating Apps and DH’s I use GitHub that just updates the existing code. As said, I can also delete and overwrite the code and do nothing to the device.

Replying to my own post since apparently just clicking on the dropdown menu deletes it and clicking the refresh icon doesn’t restore?

No worries. I wonder if the behavior I’ve experienced is because I’m using one SmartApp for different sensor types with non-overlapping capabilities or whether I could be configuring my inputs differently so they automatically pick up all sensors with the given capabilities. Here’s the relevant code:

preferences {
  section("Title") {
input "multi_sensor", "capability.contactSensor", title: "Which Multipurpose Sensors?", multiple: true, required: false
input "motion_sensor", "capability.motionSensor", title: "Which Motion Sensors?", multiple: true, required: false
input "leak_sensor", "capability.waterSensor", title: "Which Leak Sensors?", multiple: true, required: false
input "power_outlet", "capability.outlet", title: "Which Power Outlet?", multiple: true, required: false
  }
}

Does this mean commits you push to linked GitHub repos are automatically published (assuming no compile-time errors)? This doesn’t seem to be the case for me. Do you need to configure it for this? There’s a pretty clear difference in the IDE between imported from GitHub and publishing.