Yeah, for me this is done with a little rule that fires each night at 5am if I remember correctly, to reset the switches according to who is at home so that they get their message when they head downstairs
Does this have to be via RM4? I have the same thing setup via the in-built Notifications app and makes this task soooo much easier. I would recommend you give it a go.
Welcome to the Community!
I couldn't figure out with the built in notifier to do the "Echo Speaks" actions. I could get it to say a phrase, but not run them.
No multiple conditions available (both motions), no limit of once per day, and no Echo Speaks actions of random Good Morning,and weather update.
I did look at that first, but what I wanted was a little more demanding
The End-IF added
Thanks for that. Also added the weather update.
Final results! Hope others can use this!
I always prefer using RM because I can achieve exactly what I want with full transparency. I usually find when I use an app that either I don't properly understand what's happening or it won't do exactly what I want. Choices!
Updated - with back to back echo speaks commands, it was skipping the good morning message. Added a delay, and it is now working! (Updated Time end in order to test )
This community is second to none! Thanks all
Sorry for the delay - busy week.
One refinement you might consder here is to create self-contained code. Rather than having a second rule, you can instead use a slightly massaged version of this one rule:
I've chosen to use the private boolean rather than a named variable, but the effect is the same. The important part is to have a nested pair of if/then/else clauses like this:
IF (within time range to run once) THEN
# Use a gate variable to only do it once
IF (gate-variable is true) THEN
set gate-variable false
# do your actual stuff here
ELSE # not within time range...
# ...so reset our gate.
set gate-variable true
There are advantages to using a second rule to clean things up (for example as you describe above, if you need to change a lot of things at the same cadence) but my experience has been that putting things in one place as described here tends to make them easier to maintain in the long term. As things get more involved, you may have more and more rules with more and more complicated interactions, and that can get pretty confusing.
Thanks for this, I do like your example having it all contained within one rule. I think I did it my way more due to Rule Machine was very challenging to use - doing nested if-then statements. I get it now more than before I did this. The only Rule Machine I had was a simple 'Good Night' that turned a bunch of things off with the mode change. Adding a set global variable to false was easy to edit.
I guess I also need to rename my Echo to Echo McEchoFace! Lol - liked that part best.
I did re-write this - here it is, but I have a question:
Since it triggers on Kitchen motion, if there is no motion from 10:16 AM and 7:15 AM the next day, will my variable will get set to false?
It seems like if this were only needed to run once the simplest way would be to use a wait for conditon
Trigger: time 8:00AM
Wait for conditons Motion active in master and motion active in kitchen
Sorry for the delay responding. You're right. I'll note that the suggestion by @Hasty1 is probably easier, but you should probably add a delay to reset instead:
if (time between ...) THEN
if (saidIt = false) THEN
set saidIt to true
set saidIt to false delay 3 hours