Help with this rule


#1

This rule is true but the lights have just gone to 100%. Not sure why. Any ideas?


#2

The updates on the Rule details is not dynamic. Are you certain it was true at that moment and not actually false? Are certain the lights are at 100% and not 80%?

Open a log in another tab and you can confirm the events.


#3

I am sitting in the room watching the hockey game. The lights go to 20% because I turned the TV on and the power goes higher than 10. But as I am watching for some reason the lights go back to 100%. Then after awhile the dimmed again to 20%.


#4

It keeps showing as true.


#5

I have no idea why they would go to 100% as your rule states 80%. But I didn't know if it would be helpful if I told you what I thought the rule would do? Anyone who reads this please feel free to let me know if my logic is wrong. It is an interesting rule, and just want to make sure it is doing what you expect.

Assume everything is off in the room (rule false), you turn on the tv (rule still false) - nothing happens because there hasn't been a truth change

You then turn on one of the two lights to 100%. Now the tv & one light is on (rule now true), rule machine turns on the second light and sets both lights to 20%.

You turn off one of the lights - no truth change. Nothing happens.

You turn off the other light, now both are off - truth change to false. It will turn the lights back on to 80%. That then triggers a truth change to true (because the TV is still on and now a light is on), so it will lower them back to 20%.

Getting the lights to stay off would probably be a challenge. Likely turn off the tv first (rule false, lights go to 80), then turn off the lights. Since the rule is still false, it shouldn't turn them back on.

A possibility that might be causing you issues - I have no idea how much power a TV uses. But could it be fluctuating around 20, changing your rule back and forth between true and false?

Not sure if that is helpful - but that's what i got :slight_smile: Good luck!

Also, SmartHomePrimer has good advice:

Leave the log tab open and when things go awry check to see what happened to cause the lights to change.


#6

I would put a delay on your actions with cancel. Any fluctuate in power sensing is going to drive the rule crazy.


#7

@Navat604 I will try that.

What is actually going on is that the lights are on at 100%. Then I go and turn the TV on which makes the power for the zwave switch go above 20 watts. The lights dim to 20%. All good! I am watching TV and then all of a sudden the lights go to 100%. Even though the Rule is still saying TRUE.


#8

Should I put the delay on the TRUE Action or the FALSE action?


#9

You can put on both. Just a couple of seconds.
Only way to know for sure if the rule stayed true is by looking at the log or leave the live log open while testing as @AndyM mentioned.


#10

I did check the logs and left it open. It never said false.


#11

Would you have any other rules that also involve those lights? The reason I ask is because you've stated several times they go back up to 100%, when your rule clearly says 80%. Do you have any other rules/apps controlling the lights that could be interfering - such as when there is motion put them to 100%?


#12

Here is another one. Very basic under cabinet lighted to dim at 9:00pm. Logs say it did it but it didn’t. Lights are still at 100%.


#13

I do have another rule that turns them on to 100% at sunset -20. I have changed them to both match 100%.


#14

OK - possibly too many issues at once. Hopefully not confusing.

But if I'm reading your undercabinet rule correctly - it says when the time is 9pm, turn the lights to 30%. I don't know if that was triggered or not at 9pm, but the log seems to be saying that at 9:27pm something (likely another rule) told the lights to go to 99%.

I would suggest going into the devices that are changing when you don't expect them to and look at the "in use by" section.

.
To help you diagnose, it would be really helpful to confirm that other rules aren't also interacting with the lights.
Also, sharing the full log (not limited to just the device in question) might be helpful to see what other interactions were going on at the same time as the light that changed unexpectedly.


#15

I think it might have something to do with this rule I just added today. Because it is Night now. But it shouldn’t keep doing it if luminance hasn’t “become” less than 25


#16

I agree - this is your issue. This rule is not a rule, but a trigger.
So everytime the illumance changes, it checks if it is <=25, if so, it completes the actions. So the action will occur everytime a new illumance is reported that is <=25.
You probably should change it instead to a condition instead of a trigger. Such as, if it is less than 25 do X. The action will only occur if the condition changes between true/false.


#17

Changing it to a condition will fix 95% of the issue - but you still might have conflicts. Such as, you are watching tv so your original rule put the lights at 20%. Then while you are watching it becomes dark out - it will raise the lights back up to 100%.

If you change your illuminance to a condition versus a trigger, it will at least only happen once (not continuously as it continues to get darker out), but it will still unexpectedly raise your light to 100% while you are watching tv. You'll have to rewrite the rules to have restrictions. Such as, just an example, restrict the nighttime rule from running if the TV is on.


#18

I would suggest grouping all of your "requirements" into one rule with parenthesis so you're not trying to have 4 or 5 rules all doing the same thing. If you want 4 trigger events to turn the lights on to different levels when you are in different modes, take advantage of the "Set dimmers by mode" feature in the rules. This is how I got around having multiple rules for my bathroom motion for example. Within one Trigger (rule) I can set the lights to 100% during the day, 50% at night and 5% when in sleep mode. Just one Trigger to do that because I used "set dimmer by mode". You can also use "Set Scene by mode". So, for example, if you want a daytime TV watching scene and a night time one, you could trigger each based on the tv power but also by the mode your house is in.

You also have to remember, if you have a trigger defined with Two Events, it is going to execute those actions if either case is met. That means that if Illuminance goes to < 25 twenty five, minutes before sunset, the trigger will execute twice. That's the complication with doing things based on time and illuminance when using a trigger. If you were to move this to a rule and have the condition be time between sunset -20min and sunrise and another condition of illuminance <25 and connect them with an OR, once the rule became true at 25 minutes before sunset, the rule would not execute again at sunset -20 minutes because the rule is already true. You see the difference between rules and triggers?


#19

I will have to look at doing this but to get started and to get used to RM, I broke some of my WC pistons into multiple RM rules.


#20

Would this not keep this condition TRUE though is the time is still between sunset -20 and sunrise?