Hello Home, I'm Back - Set different modes based on time?

Sorry let me clarify, I just published 2 apps, one that changes temperature based on the 5-2 day week and one that changes temperature based on motion sensors.

Now if the user configures teh apps to only work in say night mode, I want to be able to catch that in teh install/update sections so that the app doesn’t end up modifying the temperatures on install/modify (those routines do initiate a change at load) if the current mode doesn’t match what the user selected. But how do I access that variable that which I don’t ask the user but the platform by default allows the user to set (mode)?

Ok I think I understand now. You want to not have to ask the use for the mode but not run it on install during a certain mode?

If this is what you are meaning then then there is no default “home” mode or something like that. You’d have to ask the user which mode to restrict the logic during.

Does this help? Would a code example help?

Yes and No.

Yes as in I want to know what modes the users selected.

No as in I don’t have a variable, the platform by default includes the options to select modes with ALL apps. I want to be able to access those modes the user selected (which the platform presented)

No way to access those. That’s why I ask for them in another field.

darn, was pretty sure it might exist as a hidden feature

@tslagle13: This is exactly what I’ve been looking for - thank you. One question I have, however… how does this interact with other modes / phrases that aren’t included in your code? For example, when I go to bed, “night” mode is set when there is no motion for [x] minutes. Then, I have a “middle of the night” mode, that is activated by a motion sensor in my bedroom - it sets lighting and kills the alarm if I get up in the middle of the night between certain times.

Will your app overtake these modes based on presence awareness? I think the answer to this is no, but I wanted to be sure.

Also, how difficult would it be to add the “[x] minutes before/after sunrise/sunset” logic here?

Thanks again. This is (potentially) perfect.

Will only affect the phrases you select in the app.

Really, exponentially difficult. I’d have to re work the entire logic for the code. I’m assuming you are asking because you want your house to start turning on lights when it gets dar outside a little earlier. You can add that to your “Home Night” phrase by adding a sunset trigger in there and offsetting it, but restricting it to run only when in “Home Day” mode.

1 Like

I had mine set this way before you discovered the issues earlier on. I’ll have to add this back and see if it affects anything. Should work as long as the other modes are restricted.

1 Like

Alright, I’m coming to the community for help on this. Primer: I’ve been having presence issues lately, of which I’ve been working through with the help of support. I believe I have this under control (I can’t say enough good things about the support folks… Seriously).

The issue I have with MagicHome (or is it an issue?): How do I run this in conjunction with Goodbye/I’m Back? Should I even use those modes?

I really, really, really, REALLY wish that ST (cough @Ben) would finally, once and for all, implement if/then based rule control. Please. Pretty please, with sugar on top.



I have 4 modes: Home Day, Home Night, Away Day, Away Night. and I have 4 actions with the same names.

1 Like

Yes, the 4 separate modes need to coincide with 4 separate hello home phrases. It works beautifully.

And to take it a step further…the house usually starts getting dark 30-45 mins before the official “sunset” time, so I’ve told my specific “home night” phrase to automatically trigger 30 minutes before sunset, but ONLY when I am in “home day” mode.

But @SparkyXI - I agree; I shouldn’t have to rely on other people to create apps (I’m not a programmer). I should be able to use advanced boolean logic from the app/website itself.


Ahh… I get it. So, does that mean that during those times (day, night) you are NOT using the stock ST phrases at all?

1 Like

I deleted the old standard Actions and currently just have the 4 new ones.


The SmartApp is completely customizeable. You can use the stock phrases or, like @Dave mentions, create your own and not use the stock ones.

One thing you have to be careful of is the “home day” phrase runs may run automatically when the sunrises unless you tell it not to run during another mode (such as night/sleeping mode). This might present an issue of unlocking doors, etc. if they are tied to the “home day” phrase. Just something to think about.


I tried adding this to IDE and I get a load of errors trying to save it.

All related to this: “script14179441883701558646462.groovy: 134: Repetitive method
name/signature for method ‘java.lang.Object updated()’ in class

Any suggestions?

Also, do my mode names to match what is specified in this App? What are all the possible modes I can use?

I changed my modes around and now I’m having some trouble with the app, even though I think I have everything configured correctly. I used to just have Home and Away modes, but I decided I wanted to go with modes Home (Day), Home (Night), Away (Day), and Away (Night).

First question is that I couldn’t rename the Home mode in the ST app, and when I renamed it via the web site, it didn’t work correctly. So I left the name as just “Home” and use that as the day mode. It isn’t so much a problem as it is an annoyance. I could make an extra mode with my desired name, but then I’ve got the plain Home mode hanging around doing nothing. I think I read somewhere in the forum that you can’t rename the Home mode. Is that true?

The real issue is that the Magic Home app doesn’t seem to be kicking off the Away (Day) phrase when it thinks it is. I get a notification when we leave, but the phrase doesn’t run. The history in the Hello, Home section of the ST app shows the while bubble that says “Performing Away (Day) for you as requested”, but it isn’t followed up by the blue bubble showing that the phrase actually ran, and none of the actions happen.

I am pretty sure that this only happens with the Away (Day) phrase, and that the rest of the phrases triggered by Magic Home work fine. The phrase itself also works fine when I run it myself, so I am not sure where the problem is. Do you have any suggestions for how to figure this out or what to try?


Reset it all start from scratch. Seems like an issue with your account. Support might be able to help

Deleted all my previous posts. Think they were broken somehow… Get the app at my github

Jason @thrasherlife,
I’m having the same issue/want the same mode change to happen when either the wife or I arrive back at home (set the correct mode based on where we are in the daily routine). Did you ever get any resolution on this issue?