I want to make my porch light a little smarter. Currently, it is just time based to be on at night. I now have a Hue motion sensor there as well and would like to turn the light on at a lower setting and then when motion is detected turn the light on full and then back to the low setting after motion has stopped. What are some methods to achieve this using the current apps?
I'm pretty sure in RL there are likely a few different options available. One I use is that you can set the "off" state, which could be that certain lights turn off and other may actually turn on or in your case go back to a certain brightness / temperature. I use this in my Study where during the day and night the lights turn on and off as you might expect, but in the evening some ambient lights are left on at a low level to provide a nice view when looking in the room from the hallway or living area.
That sounds pretty close. Could you show how you have that configured?
This isn't my actual setup, I thought it was easier to work through creating a dummy one from scratch to get the screenshots at each stage.
When you create your RL instance, select the "Setup Lighting Periods..." option. This initially allows you to define different on states based on either Hub Modes or Time of Day.
Back on the main screen, if you then drill into the Turning Off settings, you will see Alternate Turning Off Methods. Here you can choose Use Preset Setting for Turn Off Per Mode, with the per mode option being the important part.
Then when you go back to the Periods section from main screen, you will not only see settings for ON state per mode, but also preset OFF states for each mode:
Thanks. I am hoping to get the dimmer for the porch installed this weekend and then I can try this out.
Room Lighting would definitely work and @sburke781's example would do the trick. The other way would be to use Rule Machine and several If-else statements:
Required Expression: Time between Sunset and Sunrise
Triggers: Sunset, Sunrise, Motion, Motion inactive
Actions:
If Sunset, set dimmer to 20 level
Else-if motion, set dimmer to 100
Else-if motion inactive, set dimmer to 20 level
Else-if sunrise, turn off dimmer
End-If
Basically, you use triggers and their corresponding actions to define what happens to the dimmer. For this example, at sunset the dimmer turns on at 20%. If motion happens, the dimmer goes to 100%. After motion becomes inactive, the dimmer goes back to 20%. Then at sunrise, the dimmer turns off. The required expression means that the rule only runs between sunset and sunrise.
Based on how I have my modes set vs how I wanted this to work, I decided to go more with the @JB10 example. Just got the Christmas lights down, so it was time to get the front porch light working. Here is what I have configured and the motion seems to be working as expected. Will need to wait for the time setting to hit but that should work as well.
Thanks for your information
So the sun up trigger did not fire to turn off the light. I am thinking it is because the required expression disabled it first so I have edited both offsets to be 30 min rather than 25.
Your logs should be able to confirm this, but it does sound likely.
Sunrise worked as well, till the 30 sec delay for no motion hit and turned the light back on at 30%.
Do I just need to toggle the cancelable option on that action to resolve this?
No. Go into your required expression and select cancel pending actions when expression becomes false.
Now that I have some coffee, based your rule, Motion (Motion inactive) will always run between the times in the required expression. So, both could happen before sunset and after sunrise. This means that the cancel pending is not going to work with your current rule.
The fix is actually in the triggers. Turn your motion change to a conditional trigger. Have it be between two times (sunset -24 and sunrise-24). Going this route means that the motion can only trigger after you turn the light on and cannot trigger after turning the light off.
That will work. This conditional trigger will limit the changing of the motion sensor so that it does not interfere with the off command at Sunrise+25. The two possible scenarios it would cover:
1.) Motion active at exactly Sunrise+24. The event Motion inactive would not trigger since it would be outside the time block. The Off command would come at +25.
2.) Motion inactive at exactly Sunrise+24. Even with your 30 second delay, that would happen before the Off command at +25.
Another wrinkle. The condition on the trigger did not fix this as the actions run off any trigger. So I just changed the action to be based off of both conditions and hopefully that will work tomorrow.
Logs from this morning:
New rule with changes to the actions:
Yes and your fix should work. This is also an example as to why I do not use the trigger “change.” If the triggers were motion active and motion inactive with the conditional, that would work as well.
How would that change the actions though? Based on the logs from this morning, the issue was that the action "if motion is inactive, wait 30 sec, set dimmer" is True when the sunrise trigger hits.
Yeah, you’re right. It’s the delay the messed up the actions. Generally, I write my triggers as:
Sunset
Sunrise
Motion (conditional)
Motion inactive and stays for 30 seconds (conditional)
Then I would have my ifs match the triggers.