Rule Machine activate scene when Presence sensor(phone) is Away between certain times

Can someone please help me? I can't get this to work well. I am trying to use my cell phone as a presence sensor to activate a scene (Tucker mode- lights for my dog) to turn on when at sunset when I am away.

What am I missing?

Thank you for your help from a newb!

Conditions do not do anything on their own. You have to use them in some way. Further, I don't think you want your phone going away as the trigger event. Triggers are what make your actions run. Sounds like you want sunset as a trigger, then your phone being away should be part of some condition.

One solution:

Trigger event: Time is sunset-30

Actions to run:

IF (Phone is away) THEN
  On: Scene
END-IF

You could also add that away thing as a required expression and make your only action turning on the scene. Required expressions being false prevent rules from triggering. Either way, the condition has to be used somewhere--not just defined, i.e., made available for use--in order to work.

Also, I'm not sure what the 2 AM thing is in your condition, but if you want the lights to turn off then, you could add something like:

Wait for event: Time is 1:59 AM
Off: Scene

I'm using 1:59 AM instead of 2:00 AM in case you live in a time zone where 2 AM doesn't exist once a year. :smiley:

Ahh you're so right with the trigger event! That actually helped a lot with the other rules that I want to write. It was confusing as heck to me trying to figure it out. I followed your advise with the 1:59 am rule, but not sure if it applies to me haha

This makes much more sense, right?

Thanks again Bert!

One thing to note is that your implementation will not turn on the lights if you leave after (Sunset-0:30), in case that is something that you want to consider.

That looks good to me, assuming it's what you want (see the note from the other user above).

I was being playful with my language, but if you live in the majority of the US and Canada that observes Daylight Saving Time or similar "summer time" in other regions (and that change happens at 2 AM), this is you. :smiley:

1 Like

Good point because I am forgetful sometimes as you can see! I definitely would like the lights to turn on if I leave after Sunset-30. How would I incorporate that into the rule? :grimacing:

Ah, yes, so Rule Machine makes you be specific in what you want. I interpreting your description that you wanted the rule to turn on at sunset when you're away literally, but if you want it to turn on if it's after sunset and you are or become away, then you'll need to re-think. Maybe:

Trigger events: Time is sunset-30 OR Phone becomes away

Actions to run:

IF (Time is between sunset-30 and 1:58 AM AND Phone is away) THEN
  On: Scene
END-IF
Wait for events: Time is 1:59 AM
Off: Scene
1 Like

Do you want to deactivate the scene if you come home before 1:59 am? Here's an alternative option using a restriction for the rule instead of an IF statement. Functionally, it's the same as what @bertabcd1234 proposed...there's just an additional wait so that if you come home before the end time, the scene will turn off as well.

1 Like

Sorry Bert and Bob, had to get back to work. I appreciate all the help and quick responses!

I think I have this right now. Took me a while with all the "IF" and "AND" commands, but I think it's sorted out.

Thanks for the input Bob, but I don't mind if his lights are on when I come home. I really just want them to turn on automatically if I leave after sunset-30 so he can have a bit of light over his bed and food.

Now I will wait until sunset-30 to leave and test it hahah

I appreciate all the help and still find it confusing, but got it done in the end. Thanks for the assist!

1 Like