Routines to change location mode only work in one direction

Regular visitors will know I have had problems with a Frient motion sensor and using its illuminance sensor to trigger lights in my kitchen. I have given up on that ever working and won’t be buying any of their products in the future.

However, it occurred to me that I could get the same result by using the Night location mode in conjunction with the movement sensor. I now have a routine to switch location mode to Night at 30 minutes after sunset and another to switch to Home at 30 minutes before sunrise. The former works fine, but the latter never runs. It works fine if I run it manually.

Any ideas why this could be?

I control my hall lights based on the brightness levels of my outdoor sensor.
I have two routines which run to switch on or off a virtual switch based on outside brightness.
I find this more reliable as brightness levels inside can be affected by interior lighting levels. Seems to work well enough for my needs. My hall isn’t the brightest so lights come on a lot except on sunny days.

Screenshots of your routines would probably be helpful

@languageservicesco

Could you please enable support access on your account?

  1. Confirm the email account registered in the forum is the same one you use for SmartThings. If not, please share it with me over DM.
  2. Enable support access to your account:
  1. Go to the SmartThings Web (my.smartthings.com)
  2. Log in to your Samsung Account
  3. Select Menu (⋮) and choose Settings
  4. Toggle on Account Data Access
  5. Select the time period and confirm - In this step, please select “Until turned off”, once the team finishes, we’ll let you know so you can disable it again.

More info about this access here: https://support.smartthings.com/hc/en-us/articles/36170233944852-Enabling-Account-Data-Access-for-Support

Have you re-saved the Routine since it first failed to run? We are not party to the implementation details of Routines and would be quite plausible for a Routine to be responsible for scheduling its own next timed execution, and so ‘stop’ if something prevented it working once. I don’t find that a particularly convincing thought, but it is plausible.

It has never successfully run. I have changed it from 30 minutes before sunrise to 29 minutes before sunrise and saved it. Let’s see what happens in the morning! It is obvious that it hasn’t worked if the light comes on, as I enter the kitchen after sunrise.

Yes. The accounts are the same. I have allowed access as requested. Thanks for looking into this.

It is nothing more than described, but here you are.

And just for completeness, this one works flawlessly.

Well… those are about as simple as can be. No clue from me, sorry.

What routines are you conditioning on the Mode setting?

Indeed! Two routines set location mode to night or home as appropriate. A motion sensor uses Night mode as a precondition to switch on the kitchen lights when it detects movement. Simple as that. That routine seems to be working perfectly, I just need to get the location mode to switch to home so the lights don’t come on during the day.

The location mode was still on Night when I got up and while I was going to work. Running the routine manually changed the location mode as expected.

Now, this is interesting.

Yes, that is interesting. I had considered a.n.other automation might be changing the Location Mode straight back again but I couldn’t think why it wouldn’t also do it when the mode was changed manually. If you add ‘Routines’ to the filter it should see if any Routines or Smart Lighting are getting involved.

Do you have anything going on to link Location Mode to the Security Mode/Home Monitor? I have Routines that change my Security Mode based on the Location Mode and I’ve just noticed that those Routines aren’t being shown in the general app History any more, though they can be seen in the History tab of the Home Monitor. That is worrying.

I can’t see anything happening in the log. I don’t believe I have ever done anything with security mode or home monitor.

It does show the ‘Mode to Night’ Routine being activated, twice, just after the Location mode changes to Home. What’s that?

What I am rather expecting to come across is a Routine that says something like:

If
  Location Mode is Home
  and
  Some other condition
Then
  Set Location Mode to Night

The Location Mode would need to be a precondition in that case so only ‘Some other condition’ triggers the Routine. ‘Some other condition’ would have to be something that happens to be true when the Routine runs in the morning.

Great spot! No idea when I created it, but the routine was exactly as you expected. The routine set location mode to night if the time was between sunset and sunrise and location mode was home. That’s why it set it back to night when the routine set it to home 30 minutes before sunrise, but not when I manually run the routine after sunrise! I will check in the morning, but that looks like the solution.

I think you’re using location mode effectively as a virtual switch. So why not just use a virtual switch instead?

I have no idea how I would use a virtual switch or why I would want to.

It’s a virtual device you can create in SmartThings, you can then use it to control something in a routine or to store a state.
Here I have a virtual switch called “ItsBright” and I change it to “on” when the brightness level from my outside sensor goes above my chosen threshold.
I have another routine to turn the virtual switch off when it’s below the threshold.
Then I can control the hall lights by looking for movement detected on one of two motion sensors and itsbright is on.

Location mode is primarily intended for house states like home, away etc