[2.3.0.113 and others] RM5.1 - Last Event Device - Does not show what device is

I have many 4 button switches in which I use button 4 {push} to turn off a set of lights. I use a rule to say If (NOT Last Event Device Office_Light_Switch pushed = 4.0) THEN... This rule is used to modify the color temperature and luminosity of my RGBWW lights during the day to "follow the sun". However, if I push button 4 on the Office Switch, I want to make sure this rule does not continue to run as I have turned "off" the lights. (The rule works wonderfully and like being outside one does not really notice the changes.)

What I see is "If (NOT Last Event Device pushed = 4.0) THEN... The RM5.1 does not show me the device "Office_Light_Switch" part. This can be annoying when I have a rule that uses multiple switches and multiple Last Event Devices in it.

My request, can we please get it so what when someone used the "Last Event Device" option under the "If ... Then.." Condition that it shows us what device we are using? This would make viewing the "Manage Conditions" much easier to understand.

Thank you.

Rule setup for Office_Light_Switch This rule is used to modify the color temperature and luminosity of my RGBWW lights during the day to "follow the sun". However, if I push button 4 on the Office Switch, I want to make sure this rule does not continue to run as I have turned "off" the lights. (The rule works wonderfully and like being outside one does not really notice the changes.)

What the rule looks like when completed

I use a rule when I turn off my projector at night to "light my way to my bedroom" as that is normally where I go. However, I have built in some contingencies. It is times like this that this issue really is annoying.

This would make viewing the "Manage Conditions" much easier to understand.

Does this actually work for you? Last I checked (and this could have changed, though I don't recall), "Last event device" referred to the triggering device, which you don't have since your trigger is a schedule and not a device event. Also, your periodic trigger is somewhat conflicting/redundant with your repeat; I'd either modify the condition to check for "between two times" or trigger at a specific time and repeat until the time is after the end time.

Along those lines, because this value will (or can) change every time then rule is triggered, I'm not sure that there's any value to showing it in the editor. Additionally, when creating/editing the rule itself for the first time, it won't have any value yet, so there's nothing it could show.

Just some thoughts...can't speak to the request itself.

1 Like

Yes, it actually works. If I push button 4 on the switch that it references, the logs show the if/then skipping the the settings set to run. The catch is, it does not show you which switch it is looking at after the rule is made. For the DMode, my button 1 is set to turn the lights on and button 4 is set to turn the lights off. If, at any time, it records the last button pushed on this switch was 4, then it skips the "if (time between...)"

I found I had to put the "trigger" in as it did not always run every 15 minutes. This may be because I am still learning the RM. When I tried the Repeat every 15 minutes by itself, it did not. You are also probably correct in that I could probably remove the "repeat" and let the trigger work.

You are correct about it not working correctly until a sunrise event could populate the variable. It did work after that first sunrise. It is pretty nice as the slow rise in color temp and levels and then slow fall in color temp and levels match the outside world so one really does not notice it. It is almost like when one is outside in the morning and suddenly look up around noon only to notice that the sky looks a different color and is brighter (ok, summer, cloudless sky).

I just noticed why it might not appear to work at glance. My Mode = Sunrise rule sets the variables Master_Time_Start to the sunrise time. It also sets the Master_Time_End to Sunrise+15. After each day's initial time setting the loop as the appropriate minutes to each variable.

20211212_AutoToggleSunriseMode

Rule actions will never run if you don't have any triggers, unless you run them manually or call them from another rule. Something has to set the actions into motion, so if that was your only problem before, this would explain that.

Since this time, I have redone a lot of my rules. I now have a bunch of single action rules(Set, Verify), without triggers in them. I then create my "Action" rules (Auto Toggle, Security) that call these single action rules. It has made my rules more modular and also means I do not have to repeat the same actions in more rules anymore.

This has been an interesting learning curve, and thank you all for your assistance. It has been helpful!

2 Likes

Now that I have a little more time, I thought I would put up some screenshots (additional details) in case anyone else was curious as to what I was trying to describe.

Single Action Rules:
Hubitat_RulesExample-Set

Auto-Toggle Rules: {These rules are setup to call the Single Action based on the automation. i.e. one of my fav, the Movie Mode Start and End.}
Hubitat_RulesExample-AutoToggle

Auto-Toggle Movie Mode End {Shows how the Auto-toggle calls the set rules}
[I found I had a pattern of where I went and what I did after a night of watching "TV". So I automated the lights to turn on to light up my path, and then turn off so I would not have to remember to do it.]

An Example of the Set __ Lights On. Set-Office-Light-On {the light color and brightness follow the sun via another rule Set rule}

My "Sun Tracker Rule" - Uses Hub Variables to make it easier for my other "Lights - On" rules to call.

[Edit: Added Auto-Toggle Movie Mode End Rule Screenshot]