Trying to automate some bathroom lights, I searched for help here and thanks to @csteele I managed to make this, in with Basic Rules.
Now, because I want to "elevate" my rules, I got the need to make them in Rule Machine.
So, I wanted to translate one fully functional Basic Rule, into the Rule Machine. It looks like I am not such a good programmer (I am a mechanic, therefore I could be excused), because the lights do not behave as in the Basic Rule.
And here are the Rules Machine I have tried:
Torn ON
Turn OFF
What have I done wrong, except the fact that I put the waiting time 10 sec instead of 1 min?
Basically this is the reason I want to move in the Rule Machine, to be able to turn OFF sooner.
I made it like this and it works. It works with 1 min elapsed time for "wait for event".
My Aqara sensor, can trigger the next Active event, only after 45 sec after turning INACTIVE.
Therefore if I wait less than that, it does not work properly.
I was mislead by the behavior of Sonoff sensor (previously used in the same location), which stays ACTIVE one minute, but is able to trigger immediately after.
One important lesson learned: "know your sensor behavior, before any programming"
@jcarreira, @dpdurst you turned "my light" ON.
I feel ashamed, because I don't know if I shouldn't read some documentation, before asking this.
Anyway, I understand now that the programming options in HE are beyond my capability to improvise, without reading.
We were all where you are now. Don't worry about it. I've been coding for 20+ years and had to make mistakes to learn HE Rule Machine just like anyone else. Here's a secret every programmer knows but people outside don't.... we all ask questions and copy other people's code to get stuff working. There's a huge website (stackoverflow.com) where we do this and then copy-paste solutions directly into our projects. The win is in getting your stuff working, not in doing it without anyone's help.
I wouldn't feel bad at all about this, it took me some time of just doing some basic rules lights on and off stuff before I ventured into something more involved with the rule manager. But once it clicked with the smaller stuff it took off from there really quickly.. as we say, the lightbulb came on!
I tried the Motion Lighting App too, but I am not sure if I can pause/stop a rule there, by means of a button, when I want to take a bath, without the need of waving from time to time
@dpdurst does this actually work? Your Wait for event: MToilet Motion active is the same motion that'll trigger your rule. By definition, when the rule is triggered it'll cancel that Wait and never get to the second IF-THEN.
How I have mine is a virtual switch (over ride) and in the app have when it's on don't run rule. Or you could put in the turn off section to stop it turning off. Then using button control app toggle the switch
So much simpler to use the motion lightning app to put in an override. unless you really love programming/rule machine.
That being said I used to have the problem of lights turning off while in the bath. Now i just add another cheap sonoff motion sensor to use as secondary motion sensor near the bath/shower area to keep the lights on. Never ever had a false turn off since.