Can routines call other routines?

I want to setup a general routine that sets the state of certain things in my home. But I want to be able to trigger that under different conditions.

Can I have a routine that basically triggers another routine?

Not directly, but you just use a virtual switch. Have one routine turn on the virtual switch and have the other routine start because that Switch came on.

Alternatively, if you start using Webcore, you can probably do anything you can think of. :sunglasses:


Oh yea, that makes sense. thanks!

1 Like

Make sure you have the second routine turn off the switch again so it will be ready to use next time. :wink:

1 Like

Well, I was planning on using it as a state switch; for when home is occupied.


In that case, why not use a custom mode? That’s exactly what modes were designed for.

1 Like

Hadn’t thought of that either. Where does one set modes exactly?

I guess there are already modes for Home/Away/Night I’ll probably just leverage those.


Couldn’t find it in the app, but found it in the IDE.

All set!


Just remember you need to have a routine set the mode, it doesn’t automatically change on its own. So if you want to have the Mode set to “away” when you leave the house, Then you need to create a routine based on presence sensors that will change the mode. And a second routine based on people arriving home again that will change the mode back to “home.”

See the following discussion ( this is a clickable link)

1 Like

Yep, that’s exactly what I had setup but in a more round-about kind of way. This will make more sense.

I basically wanted to have a couple of different classes of people (my and my wife, family, and guests (like pet sitter)). I wanted slightly different behavior (like locking/unlocking door) but wanted a bunch of general things (thermostats, security cameras, yada yada).

So I can achieve that by having a general home/away routine that triggers when the mode changes, and still have specific behaviors in the routines for those classes of people.


wait s sec, looking into just using modes, but I didn’t see how to trigger a routine when the mode changes to a specific state?

It depends on the exact specifics. A routine doesn’t get triggered by and Mode change, but you can set it to only run in specific mode, so if the other trigger conditions are met that it runs when the Mode changes.

The official smart lights featured can be triggered by mode change, so you can use that to turn on a virtual switch and have that virtual switch trigger a routine. So just depends on exactly what you’re trying to do.

Yea, thanks. i think I got my self pretty confused.

What I am trying to do is essentially have “state” of my house (like Home & Away). Triggering those states when people arrive/leave. And when in those states control what is on/off.

Trying not to do too much duplication, I do have a couple of different triggers for when people arrive/leave that do different things depending on who (like locking/unlocking front door).

Does that help?

I think since I can’t really trigger an event when the mode changes (I guess I could with CoRE) I might just go with the virtual switch approach