Using Illumination to trigger devices?


#1

1) Give a description of the problem

I have been scanning the Community on the above topics and find mixed responses using luminance as a trigger. As such maybe a better way to do this

I have a simple bathroom piston that turns the bathroom light on and dim during the night and turns off 3 hours after sunrise.

2) What is the expected behaviour?
I have a Philips Hues Motion Sensor which measures Luminance connected to ST Hub and Philips Hue light bulbs connected to ST Hub

What I am wanting to do is create a new piston or extend the existing piston which
on dark mornings/days (dense cloud cover, snow etc) which will turn on the lights if Motion Sensoe triggered and the bathroom ambient is below a X luminance level.

3) What is happening/not happening?

Would be delighted to hear yours thoughts/feedback/ example pistons

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

It is definitely do-able… but I would highly encourage you to base the logic on a lux sensor located far away from the bathroom. It is unfortunate, but a good location for a motion sensor is usually not a good location for a lux sensor. (and visa versa)

If lux is your priority, you really just need one lux sensor perfectly placed that can give accurate readings to benefit all rooms. (if desired) One good place to “hide” that lux sensor is in a “sunroom” type of room… Out of direct sunlight, but aimed at the sun path. (under a chair at 45 degree angle works great, or if no available sunroom, then sheltered outside away from any bulbs)

The key to perfect placement is, the lux sensor should be far away from any artificial light. You do not want the sensor to change when any bulbs turn on or off.

If you can find that sweet spot in your house, you are golden!

The goal is, if your lux readings are 99% based on mother nature (natural light), then the bulbs inside can seamlessly adapt to cloud conditions etc.


Outdoor luminance/lux without Nest Weather
Rooms Manager: Smarter Rooms: Personalized home automation with Occupancy
#3

Thank you for the great advice


#4

I found using Illuminance to control lighting a little more complicated than I expected. I wanted a reliable way to turn lights on and off based on Illuminance even if my sensor went dead.

My other constraints were:

  1. I wanted a boolean variable @LuxOverThreshold that other pistons could subscribe to
  2. I didn’t want lights to go on and off if a threshold was crossed multiple time in a half hour
  3. I want filtered raw illuminance readings, because my sensor inputs 0 periodically during the day
  4. I want to know if my lux sensor dies. If so, setting the @LuxOverThreshold variable will rely on Sunrise and Sunset times.

I accomplished this using 4 pistons.
Filter Piston - Filters the raw input from sensor into @LuxCurrent variable
Threshold Piston - Sets the @LuxOverThreshold based on @LuxCurrent or Sunrise/Sunset
Settling Timer - Runs for 30 min and blocks any threshold crossings while running
Sensor Broke Timer - Restarts when @LuxCurrent updates. Sets @LuxBroken when 45 min expires.

I need a beer.


#5

Cheers LOL