Is there a way to use âReturn from Awayâ in RM? I set up a simple automation to turn in some lights when either my wife or I return home (cell phones arrive) but only if the other is not already home. In SA, I did this with a restriction âonly if mode is awayâ to prevent it from running if one person is already home. I tried to duplicate this in RM using;
IF (Mode is Away(F) AND
Time between Sunset and Sunrise(T) [FALSE]) THEN
On: Front Door Light, Bookcase Lamp, Kitchen Sink
Unlock: Front Door Lock
END-IF
but it doesnât run. I think whatâs happening is the presence sensor is switching the mode before the IF-THEN runs, so the IF is never true.
What I really want is a trigger âreturn from awayâ rather than âme, wife, any, presentâ, but in triggers/mode âreturn from awayâ isnât an option? I suppose I could make conditions like âNOT IF me home, and wife returns AND NOT IF wife home and I returnâ but that seems inelegant?
This is your rule.
Modify it how you'd like to fit your needs
Hope this helps.
I haven't updated the rule the life 360 is included in combined presence, so should be removed from the triggers. The only trigger for me should be combined presence.
Youâre using your rule to change the mode from away to home, I already have mode manager doing that. If Iâm understanding this correctly, I need to disable the mode manager return from away and use this rule instead? That is to say, if I just used your rule but changed the THEN to ârun Steveâs stuffâ, it still wouldnât run because mode manager already made your IF false?
I don't use mode manager. I run all of my mode changes in Rule Machine.
If you just want somethign to run based on what that mode change, then set up a rule in rule machine to trigger "steve's stuff' with mode as a condition.
here is a similar rule based on time of day. adding in a condition for mode would restrict that to a certain mode. Is this what you're looking for kind've?
The quirk is that I want to run it based on what the mode changed from (away, in my case), the RM mode triggers all seem to be what the mode changed to (pick from the list)?
Though it does allow mode changed, period... maybe thatâs an angle...
Yah that's a tough one. I think you coudl do that with a boolean but I am NOT the one to ask about that. Variables are my weakness. you'd use true and false to represent that. I think that @aaiyar might be able to weigh in on that one. There are others, but I'm drawing a blank on who's good at this.
Thanks, I havenât tried global variables, maybe thatâs what I need. Iâm starting to think using RM In lieu of mode manager to manage the mode change back from away is clean though. That way I could run whatever else I like just before I switch the mode back to whatever it should be if not away...
Iâm far from a RM expert, my brain wasnât exactly built to do these kinds of logic expressions!
However, I think @at9âs suggestion is a good one. Make a rule that sets a GV when mode changes to away. Then create another rule triggered by arrival, with actions that run only if the GV was set to away, and also reset the GV.
I do exactly what @at9 suggested, except in Node-RED. I save the mode to a variable called "previous_mode", which changes 5 minutes after the mode changes. During the intervening time, which is sufficient for my flows, mode-dependent automations can be modified based on what the previous mode was ....
Edit: and as he suggested, this is easy to replicate in RM with a global variable