Automatic Updates and Subscription to Events of Devices on other hubs

Is it possible for SmartApps to automatically update themselves on a schedule. Such as:

schedule(“0 0 12 1/1 * ? *”, updated)

So it will run the updated method included in all SmartApps every day, so I wouldn’t have to go to the web IDE and update it manually. Is this possible or are there any other ways of updating multiple SmartApps faster?

What exactly are you trying to do? Can you provide more details?

I have many instances of a single SmartApp being used by multiple Things, and I want to update the app regularly. But since there are so many instances of it, I’d have to click update in the web IDE far too many times if I wanted to push out updates. Will scheduling the updated method work for automatic updates of all the apps, granted I update them all manually one more time.

I have some apps that subscribe to a virtual switch. When the switch is “flipped” it updates the schedule in the SmartApps. I originally created it for when the scheduler failed routinely. I had IFTTT trigger the switch so the schedules were always resurrected. It worked well.

So does flipping the switch call the updated() method in the apps? I like this idea as its more under my control rather than a time-based event

Yep. It worked well. The apps subscribe to the switch.

1 Like

@ady624, can we do something like this for CoRE? (If it would reboot Rules after updates). It could be automated and invisible to user.

Sure. Would you like some fries with that?! LOL

I will add that to CoRE and possibly the dashboard?

Yay! Curly fries please. :wink:

Will this work if I have multiple hubs? Would I need to create multiple virtual devices or only one?

I suspect you’ll need one per hub.

Dang, this doesn’t really solve the problem, as I have a lot of hubs with only 6 or 7 devices on each. Any other ideas? Or is it possible to subscribe to the events of a device that is not on this hub or location?

Good luck. AFAIK ST wasn’t designed with the idea of multiple hubs in the best way possible. Furthermore, I doubt “lots of hubs” was even a wet dream. If you can find a way to have a device visible to all hubs, then one will work. Otherwise, your use case goes outside the scope of the ST and the way a hub works.

How many hubs are you talking? The simplicity of one switch per hub is hard to beat. Maybe someone else has a better idea.

Around 75 hubs

1 Like

Who wants CoRE to be able to execute pistons across hubs? Or maybe even share global variables across them?

Can it be done without installing on all 75 hubs? Because that’s what (I think) he’s hoping to do.

That I can’t answer… I would assume so, I don’t have two hubs to see what’s common to all and what not. Does he have 75 hubs under the same account/location? Does he have 75 accounts? Lots of questions. But I am open to ideas and ready to find solutions :slight_smile:

1 Like

You rock @ady624

1 Like

75 hubs at 75 different locations

On 75 different accounts or same account?