RM 4.0 Rule Questions and Optimizations

If the bulb is turned off, the raising/lowering will most likely turn it back on again upon the next step. It will work over a long period of time. If you want this affect and the ability to turn the light off for some period during the transition, use a virtual CT bulb for the rule that does the transition, and figure out a rule to link it to a real light -- one that can be turned off. In that rule you would simply test if it was on before you'd send the new CT value to it, only sending it when the light is on.

Trigger Event:  CT of virtual-ct *changed*
Actions:
   IF(real-light on) THEN
      Set local-variable-ct:  %value%
      Set real-light CT: %local-variable-ct%
   END-IF
1 Like

Ok. I have another rule engine question to solve that I can't quite figure out the logic on. I have a motion sensor that I have triggering lights on if motion is detected in my basement. What I would like to do I create a rule that will turn the lights off if the motion sensor goes inactive and remains inactive for 15 minutes. If motion is detected again during the 15 minutes, I would like to cancel lights turning off.

Can you help a Hubitat Brother out?.

Thanks in advance.

Simple lighting
Entry for both your on and off requirement


entry for just the turn off

1 Like

Wow. Ok. I forget how powerful the Simple Lighting functionality is. I'll give that a shot.

Thanks for the quick response!

1 Like

Hi, I found a bug at RM 4.0,
After I edit a rule so a Divice is no loger part of it.
At the Device Details underr the In Use By section, keeps listing the rule as if it is using the dive on it )But the divice is no longer used there.

I have try to copy the rule to solve the issue, but it odese not work.

This is a long standing "bug". It does not hurt anything, it really is not in use.

The only way to truly get rid of it is to start over with a fresh rule. This is a post by the author, Bruce.

1 Like

Note: I have found with the 2.2.3 release that the ‘in use list’ is updating better when you do remove a device.

This issue was mostly fixed recently.

2 Likes

Trying to use a Global Variable to set dimmer values in the "Dimmers per Mode" option. I have tried it with my variable, Evening, as a NUMBER and a DECIMAL. When I try to put %Evening% in the "Level for Evening" setting I get back: ** bad value: (%25Evening%25) **

What am I doing wrong?

Figured it out. %Evening% is reserved I guess. Would be nice if it would say that or if the Globals were defined independently of the system variables but okay I can move on now. :slightly_smiling_face:

I am wondering if someone can help me with this and tell me what I am doing wrong. I thought I had this, but it seems I don't know what the heck is going wrong or what I am missing. In the morning, 8AM, I have my dehumidifier turn on and turn off the A/C units upstairs (mini-splits). The dehumidifier runs all day and I have it monitoring the power meter on the plug. When the time is 14:00-17:00 and the watts drop below 80, it waits two minutes then turns off the plug and then turns the A/C back on. I am using this to let the compressor turn off and the fan run for two minutes after the compressor turns off so it doesn't do a hard power off. This has worked on ST with a automation but I can't seem to replicate this in RM. Can someone help me with this? I have been working on this for several hours and it just doesn't want to work.

In this case I would make the trigger whenever the humidifier power goes below 80. Then your condition would be the time only. Since RM is event based the power going from above 80 to below 80 will only happen each time it does that transition and when the hum is on, so it shouldn't be needed in the condition (you can double check for the hum being on if you want). Therefore the only condition really necessary is the time.

Why don't you use 'Dehumidifier becomes on' as the trigger? You aren't even looking at the off condition. Then you could get rid of the first part of your conditional, and just look at the power level.

Or, what is posted just above. Power level becoming less than 80 surely means it's on.

I tried "on" also and it didn't seem to work.

On the device page for the dehumidifier, click on Events at the top. Post a screenshot here.

Hi @bravenel, just for my knowledge. If the trigger was 'hum turns on' then wouldn't the rule only run once at 8am (it was indicated that's the 'on' event) and then never again until the hum went from off to on again? Therefore the rule would never get triggered later in the day to be within the 1400-1700 window, or am I misunderstanding the trigger?

Yeah, it has to be triggered from the power level, clearly. Even at 0 power, it doesn't send an off event, or an on event after that.

Thanks for clarifying, I thought I understood how you were explaining the way trigger events work during our event vs. scanned discussion and just wanted to be sure I was thinking correctly. Thanks again for all the work you and the team put in with RM, Have a great night, off to watch the Flyers.

So it can't be done this way? If not any way to do it?