I have a small problem that my little brain can’t figure out,
Using my light meter I want to turn off Light-A every morning between 0600 and 1000, but only when the brightness is below 80 lux.
It sounds like a simple problem, but I can’t figure out how to solve it.
There isn’t quite enough info here.
- What happens if someone turns on the light in that time frame? Is it to immediately shut off if the light is below 80 lux (I assume you have a sensor for this)?
- Is this light on all the time at night and that is why it needs to shut off?
- What automation system are you using, hubitat, smartthings, something else?
Personally, I’d create two Smartthings routines.
Routine 1:
Precondition: Lux below 80
Trigger: time of day (0600)
Action: Turn off light A
Routine 2:
Precondition: Lux <80
Precondition: Time is between 0600 and 1000
Trigger: Light 1 turns on
Action (Option 1) If Light 1 turns on, turn off after x minutes (assuming you want it left on).
Action (Option 2): If light 1 turns on, turn it off. (if you want immediate shutdown)
Ken_Weise thanks for taking the time to reply.
It must have been my offday -sorry.
I’ll try again:
You can’t turn the light on or off manually.
The light turns on automatically every day at 04:00.
What I want is for the light to turn off when it’s between 06:00 and 10:00 AND the brightness is under 80 lux. (I have a light meter.)
Yes, I use Smartthings and SharpTools.
I like @Ken_Weise recommendation. I do something similar in SmartThings rules to turn a fan on / off based on humility (or lux in your case).
Then let’s rewrite my routine. I’d still do this as a Smartthings Routine
IF Section
As a Precondition: Time is between 0600 and 1000
Trigger: Lux is below 80 (this assumes the LUX meter is smart and connected to Smartthings)
Then Section
Light A - Turn Off
The key here is to use the changing light condition as a trigger and the time as a precondition. This means that the trigger only fires during the timeframe. If both are used as triggers, the routine will never run because the time range only triggers at 0600 and it must simultaneously change below 80 lux.
Only use one trigger per routine, and make everything else a precondition. Think about your trigger, and what you really want to set the the routing in motion. Using more than one trigger will get only get you failure, frustration and heartbreak.
In SharpTools Rules, the equivalent of what Ken mentioned would be something like the following:
‘Changes To’ vs ‘Updates’
Note that in this example, I’ve checked the box for ‘On Transition Only’ within the Trigger – that way the rule will only run when the light changes from above 80 lux to below 80 lux.
Of course, if that’s not what you want then you could uncheck the ‘On Transition Only’ and it would read like lux updates and is less than 80.
As with Ken’s example, this rule is triggered based on the lux value updating. If the value is already below 80 and stays constant during that time frame (unlikely if there’s a changing light source like the sun), then the rule wouldn’t trigger.
Logic Question - Reverse Lux?
If the goal is to turn the light off when there’s enough ambient light provided by the natural light from the sun, wouldn’t you want your trigger to be when the lux level was above a certain value?
You would need to monitor the lux levels to see what’s reasonable for your setup, but I would think that the light turning on would provide a certain maximum lux level within the room (assuming the sensor is in there) and when the ambient sunlight provided more light than the lightbulb, you could shut the light bulb off at that point.
Light Off - Fallback
You might also want to consider if there is some other fallback condition at which the light turns off. For example, some people might want the light to automatically turn off if the desired lux level was reached between 0600 and 1000 and if it still hadn’t reached the threshold by that time, perhaps you still might turn the light off at 10:00 or some other time.
The easiest way to do that is to setup another rule to handle that particular time as a trigger.
You can do it all in one rule within, but it could get a bit messy to nest the conditions and check the trigger types. Some people prefer keeping the logic all in one rule though.
Thanks - the problem is solved.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.