Automatic Updates and Subscription to Events of Devices on other hubs


(Alex) #1

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?


(John) #2

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


(Alex) #3

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.


(John) #4

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.


(Alex) #5

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


(John) #6

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


(Brian) #7

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


( I hate Mondays) #8

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

I will add that to CoRE and possibly the dashboard?


(Brian) #9

Yay! Curly fries please. :wink:


(Alex) #10

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


(John) #11

I suspect you’ll need one per hub.


(Alex) #12

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?


(John) #13

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.


(Alex) #14

Around 75 hubs


( I hate Mondays) #15

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


(John) #16

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


( I hate Mondays) #17

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:


(Tim Slagle) #18

You rock @ady624


(Alex) #19

75 hubs at 75 different locations


( I hate Mondays) #20

On 75 different accounts or same account?