Adjust light level on a motion mode activation

I have a routine to turn on my bathroom lights with two sensors. The lights turn off after 3 minutes of no movement. On several occasions the lights have gone out so I added a door contactor and created this routine (see images). I would appreciate any feedback to improve it. On the other hand, I would like to be able to change the lighting level and that once the sensor detects movement, it does not return the level to what is set in MODE LIGHT. After three minutes it turns off the light. Thank you


If you want to avoid the dimming changing:

  • First I would separate the first rule into two, one for each light
  • On the rules, you could add a “Use Required Expression”: Light is off

To turn off with no motion, you could also add the following to the new rule(s):

  • Wait for Expression: mZone-… all motion inactive AND Bano Principal Door Contact open and stays that way for 0:03:00
  • Off: Light
1 Like

Thank you
Can you please explain
why is better tu separate for each light?
What is the function Use Required Expression not clear how it works

Regarding the Turn Off motion - Bathroom door mostly remains closed when the bedroom A/C is, so if someone leaves the bathroom and closes the door then lights will stay on since it would be waiting for door to open correct?

Separating for each light is to ensure that any dimming you made to the light will stay the same. Otherwise, the options are either to reset the light to the dim level set in the rule for both lights every time, or either when one or both lights are not already on.

“Use Required Expression”: The rule will check if the condition is true. If it is, it will run the rule. If it is false, it will skip running the rule. It’s essentially a conditional action for the whole rule. Makes sense?

If the door remains closed, then yes, the light will stay on.

If you want to ensure that it stays on when someone is there, and off when no one is there regardless of the door status, you would need to get a “Presence” sensor. Aqara FP1 is a good option for these, but they require a permanent power supply. Inovelli is working on a switch that will incorporate a presence sensor and should be out later this year / early next year. This will however require that your switch is inside the bathroom and has line of site of the whole room.

1 Like

Thank you, I will try the changes. For sensors I have GE/JASCO 26933 Dimmer and Zooz ZSE18. When shower door is closed, it blocks Zooz sensor and GE Sensor could be configured incorrectly. There are times that lights go after 3 minutes when bathroom occupied. Sensor is installed in small-mid bathroom facing sink and toilet.

To see through the bathroom door, a mmWave presence sensor is required. Jasco and Zooz sensors are not mmWave presence sensors, unfortunately. They are motion sensors.

@RickyV

I’ve read of people using an outdoor motion sensor in the shower (although that may awkwardly look like a camera 🫣) or using a humidity sensor right outside the shower to determine if someone is in the shower. You can also use the same humidity sensor to automate your exhaust fan if you wanted to.

1 Like

After some trial and error, this routine is working well to control that light on my bathroom don't go off when occupied. Still trying to figure out how to "Use Required Expression". you mentioned that it needs to be separated for each light. Can you provide a simple example?

Thank you

Separating the rules, one per light, would be required if you don’t want the light to adjust when it is already on. This is where you would want to use a Required Expression which would be “light is off”. This would mean that the rule would not run if the light is on, therefore would only adjust when it is off.

Thanks for the feedback. Let me make the rule change to one per light, but the problem I want to eliminate is

When I enter the bathroom, the lights turn on according to the modes. There are times when I want to modify the light levels (either more light or less light), however once I adjust the lighting level after a few seconds if any of the motion detectors are activated, it goes back to the levels determined in mode lighting. You mentioned "user required expression" to avoid that problem but I don't know how to use it or how to incorporate it into the rule.

If you can help me with a simple example it would be of great help.

First, click on the “Use Required Expression toggle”:

Then, click on “Define Required Expression”:

Then within that screen, create a New Condition:

Chose “Switches”, pick the switches that need to be Off for the rule to run, and select “Switch is” “Off”:

Complete the required expression, and the end result will look like:

Hello, thank you very much for the information shared. For a few days now I have been testing the information you shared but I am not clear. As I understand this "Use required expression" it is necessary to be fulfilled for the rule to continue. I already tried a closet light where I have a motion sensor and a dimmer. In "Use required expression" I set closet light to zero and now every time I enter the closet the light turns on at one level and turns off in a loop. I have to manually adjust the level at which the on/off loop stops. I imagine I'm doing it wrong. What I would like in the closet light is that if I touch the light to change the level at which it is programmed through mode (example 50% dimmer level at 8:00am, 70% at 9pm) if I manually adjust it to 90% when I am inside the closed the light remains at 90%. What is happening is that when I am inside the closet for some time and the sensor detects movement while I am there, it takes the light level to the default by the mode and does not leave the 90% level that I had set while the closet continues to report as occupied. . What I would like is for it to maintain the light level that I manually changed and for when I leave the closet to turn off the light 3 minutes later. If I enter the closet again after a while, return to the levels established in MODE LIGHTING. Thanks for the support.

To ensure the light doesn’t adjust with motion, I would add a required expression: « Light Off ». So if the light is already on, it won’t automatically adjust. However, when the light is off as you enter the room, it will detect motion and turn it on.

Hi there. I made the changes you suggested and created one routine to turn on lights by mode using motion as my trigger. Selecting Define Required Expression that all lights Should be OFF. That let's me modified the light levels on all lights preventing the routines set light levels set in the mode if once it detect motion.

Then I created a routine to turns light off. Please feel free to comment if needs improvement.

Thank you

1 Like

Looks good - the key is that it works for you! :slight_smile:

On the “Bano Principal OFF” rule, I don’t think that the if expression adds any value. I would just keep the off command.

I can’t see anything to change or improve on the “ON” rule.

1 Like

Thank you for the feedback. Appreciate all the help. Learned something very useful.
Let me make the change on the OFF Rule

Best

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.