Simple Lighting Illuminance

Anyone know when using a Simple Lighting app to turn on a light based on Illuminance , will the light go off when the iIluminance is outside of the specified level? I know I can create a rule to do this, but I figured since its a simple app, it would make more sense just to use simple lighting.

I just went through the rule and I don't believe that it will because there's not an option to do so. Since there is not option, it will not automatically assume that you want it off. you would need to create a different simple lighting rule to cover the greater than command to turn off.

[Edit] I feel like doing that in simple lighting is still a good way to handle the rules. Even if you have to build two. The KISS method always seems to be the way to go. It helps to keep rules straight when troubleshooting things down the road. I always like to do separate rules for on and off in case I want to throw in a restriction to further the rule.

Maybe it would be possible to add an off option also.

The problem is the minute you put parameters in it, you've just complicated the rule. Then move it to rule machine. It is no longer simple. On and sunset off at sunrise is simple. Two set times. On between an adjustable set of parameters is not simple. It's not really meant to be that complicated. It's just as easy to write the second rule to turn it off.

I disagree I do not think its that complicated. It is a simple set value of X and either the light is on above/below that value or its off. I can get much more complicated with motion/mode lighting and not even use RM.

I can definitely respect your opinion on that. Although I don't agree. Simple lighting is not mode or motion lighting. You can trigger a light by mode in simple lighting as well. It's built for one function. Not parameters. There is not an option to reverse the command in every one of the functions. Just a select few. It was intended for one simple rule to trigger. That is it.

Actually, to play devil's advocate, only 3 of the triggers don't have reverse toggles, luminescence, smoke and CO. Kinda makes sense to me to have a reverse toggle. I can see this being used to control a porch light. There are days that it's bright right till sunset and others it's practically black long before official sunset.

I just got done doing this. Originally I had two Simple Lighting rules, one for ON and one for OFF, utilizing different illuminance thresholds. I believe I've simplified it into one rule here using Rule Machine:

Edited:

illuminance

The key is using the delayed off, pending cancellation. That means if it's a cloudy day and the illuminance hovers around the threshold, your lights won't flip on and off erratically. There might be some flipping back and forth if the conditions are just right, but this should mitigate it somewhat.

One thing you have to take into consideration with using an illuminance sensor to turn on and off a light is the need for a hysteresis between the value that turns the light on and the value that turns the light off. Since illuminance can fluctuate, you don't want the light to annoy the user when the sun is just setting, or clouds pass by,

Using Rule Machine with two separate rules (one for on and another for off), each with difference threshold values might be the best solution.

Or, you could write a custom App for the Community that handles this case assuming one doesn't already exist! :wink:

Yeah this looks exactly like what I was thinking, I will just use RM in this case.

I was originally going to use APIXU as kiowatts has done above to trigger lights inside when its raining or cloudy during the day. These are lights that stay on after sunset anyways and are not trigger by other means. The APIXU weather driver has a 30 minute delay between new lux readings, which should prevent the problem of the light going on/off constantly. Then again adding a specific delay would also ensure this does not happen, which is not possible in simple lighting.

1 Like

Looking at the above rule, I think adding a delay to the On would be good too, just to create some more buffer when the illuminance rises back above the threshold.

Now there's a word you don't hear everyday. In fact, apart from at work (we do a leak hysteresis test on one of the systems i work on) I don't think I've ever heard someone use that word.

However, I think the word you're looking for here is differential. Hysteresis is a lag between the measurement of the value of a physical property and the effect causing it. You can't have a hysteresis between two values of the same property.

Yeah makes sense. In the past I attempted to setup lux rules with the Hue motion sensors but found the readings to be too inconsistent and not reliable. Recently I found @bangali's ApiXU weather driver and figured it was exactly what I was looking for to control lighting inside based on outside conditions.

2 Likes

Hysteresis is commonly used when discussing the behavior of a thermostat, to avoid having the HVAC system system cycling on and off continuously relative to a set point. It is in this context that my comment was made. It seemed a very apropos use of the term given the subject matter.

Possibly a better control system term would be to create a deadband relative to the target, within which no changes are made to the manipulated variable, until the controlled variable changes enough to exit the deadband and allow the controller to start making changes again.

I've been designing and building real-time control systems and machine sequencing for 28 years.

3 Likes

I was just going to search that out and post it. Good thing I looked again!

Histo - what? C'mon ... we know you're both geniuses. Can you dumb it down for the commoners like me?

2 Likes

I don't disagree with your intention. In fact I agree 100%. And I wasn't questioning your knowledge or background. I'm just going by the definition of the word. As Inigo Montoya said, "I do not think it means what you think it means."

Hi Guys
As this is Simple Lighting Illuminance thread I'd like to describe a problem that I'm faced with.
I created a Simple Lighting rule that turns lights on in a hallway when Lux reading is 3 or below (it's a Hue MS and it reads Lux very low). Then it's supposed to turn the lights off after a minute. Well, it doesn't. The thing is that when the lights get turned on the Lux is 3 or less but then the Lux reading is around 30. Is it the reason they do not turn off?
I changed the condition of Lux to 39 and the lights come on and off.
Below is the rule. Have you any suggestions how to change it or is it a bug?

From what i can see in your rule, it will not turn off because of your restriction.
Light comes on.
Lux goes above 3.
Restriction kicks in.
Rule stops.
Light will not turn off.
This is the problem of using an lux sensor in the room you want to do actions in.

There is a way round this though.
Use Cobras Average All app.
A virtual Lux device.
A virtual switch to disable things.

If you are interested I can post details.
Maybe someone has a better way.

You hit the nail right on the head. The lum reading is restricting the rule from firing. In this case, since the lum sensor is in the space that you're lighting, the lums will go way up when the light is turned on. This should probably be adjusted in Simple Lighting to only restrict the turning on of a light instead of both the on and the off. Tagging @bravenel

As a work-around, you might consider using a weather-sources lum reading for outside. For example, I'm using the APIXU weather device. It updates Lum readings for my location every 5 minutes or so. That way, the reading is less dependent on the lighting within the space.