App calling another app

Is it possible for a custom app to command another app? E.g. to trigger a rule or to call a method on another app instance like thermostat scheduler ?

Not directly. There are ways for apps to communicate with each other. Parent apps can call methods in child apps, and vice versa. It is possible to open a dynamic page in another app in the UI. Apps can throw events that another app is subscribed to. Etc.

Would it be possible to create a variable controlled by one app, where a secondary app does another action based off the variable that the first app is manipulating?

Right however it appears parents can only have children that explicitly state who is their parent.

I found this which I think should be enough for my use-case : Rule Machine | Hubitat Documentation

Thanks for your reply!

webcore can have pistons call other pistons....

1 Like

I'm sure one could do that using hub variables.

However it doesn't address my use case, which is to command a (possibly built-in) app from my custom app at runtime, i.e. without access to the target app's code.

in general built-in or other apps how they trigger depend on the particular app design and inputs. There is not a generalized formula.

Yes if apps are designed to work together, they can trigger on many different things including a hub variable changing.

Ok, so let me start by saying I'm new to app development (and Hubitat in general). I've created a 2-part app (Parent-Child) that I've got functioning. Essentially, the only thing the parent does is create a child and exit. The Hubitat app screen then shows my parent with all the created children listed under it (like rule machine or any number of other apps).

I would like to automatically jump to the newly-created child from the parent (not that it's that hard to exit and click), but I can't for the life of me figure out how! Any help would be appreciated. And assume you're talking to a complete newbie.

Thanks!

Check out Button Controller. It does this -- so you can see it works. If you don't have a button device to use, you can create a Virtual Button to check it out. When you create a Button Rule, it creates the child app and launches it... I think that's what you want.

You already know how to create the child app. To launch it, you want this secret sauce:

paragraph "<script>{window.open('/installedapp/configure/$child.id/selectActions?resetScroll=true', '_self')}</script>"

Except, where it says selectActions you want the name of the main page of the child app (that happens to be the name of Button Rule's main page). child.id is the app id of the created child app.

1 Like

Thank you very much! I had to simplify the script a tiny bit to remove the selectActions stuff, but then it worked great. Now my only minor issue is that when I exit the child app, it goes back into the parent app. I could easily exit the parent app upon return if I knew how, but there doesn't seem to be any sort of "exit" method available...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.