How to control lights based on luminescence AND motion


I’ve bought a couple of Fibraro Motion Sensors as I want to be able to only turn lights on/off when luminescence is below/above a certain leve and there is motion.

The Smart lighting app only allows one variable (I am currently using if there is motion then turn on, turn off after x minutes of no motion).

Only other way I can think of is through the Rule Machine app but I know this is not what it is supposed to be used for and it also doesn’t have the very important ‘turn off after x minutes of no motion’ that smart lighting has.


Tagging @bravenel


Rule Machine will do exactly what you want, including turn off after x minutes of no motion. Here is a sample setup that does this:
<img src="//" width="281"height=“499”>

The way this works is that assuming illuminance meets your condition, once there is motion on Bedroom Motion, turn on Master. When motion stops, start a delayed command to turn Master off. However, should motion start again, cancel that. This has the effect of the lights turning off when there is no motion for 3 minutes, in this example.


Outstanding. Thanks - rule machine is seriously a masterpiece.

1 Like

Should this work for simple motion controlled lights?

Yes it will…20 chars

Don’t forget to tick the option when doing the delay to ‘cancel on truth change’ - stumped me for a while before I used my eyes!

Okay - epic fail on my part for not thinking everything through - I currently have a fibaro sensor in my main living space.

  • After some fine tuning with report frequency etc I’ve now got it working well based on motion & luminosity through Rule Machine. So if you enter that space and there is not much light, lights come on. If there is more than x lumins, lights don’t come on.

  • Problem is: Once they are on, I obviously can’t use the same fibaro sensor to see when the lumins go up enough to turn off the lights again (as the lights are on in the same room as the luminosity sensor and so it won’t change until the lights are back off again!!)

Anyone any ideas as others must have come across the same issue? @bravenel

Only solutions I can think of are:

  1. Automatically turn the lights off every hour to see if the light is enough to turn off the lights until they dim again. Rediculous.

  2. Go back to what I was doing before (lights off based on time so when mode is switched to ‘daytime’ the lights go off. Then manually control after that if needed. Okay but not ideal.

  3. Buy another Fibaro sensor to be used in a separate area that is then used as an ‘indicator’ device for the main living space. Maybe point one outside?? This would work okay once fine tuned (usually - depending on the lovely constant cloud movement we have here in the UK) but if lights were on in that area, the same problem would return.

Please help anyone!

@primarypete May I ask what your settings are for your Fibaro. I have several of them and am trying to fine tune them some as it will cut down on traffic. I know each end user has their own use case but sometimes seeing in action with what others are doing is helpful. I am sure Bruce will provide you with an outstanding solution using Rule Machine. Thanks!

It was my fault with my own bad logic (ie lights go on… lumins increase… lights go out as a consequence…) I’m going to invest in another one for outside that I can then use as a ‘guide’ for turning lights off again after using the room fibaros to turn them on. If that makes sense. All through the super sweet Rule Machine.

No idea if my settings are good / right / waste of battery but they seem to be working as required for now anyway!!!

In sensor options:

1 = 8
2 = 8
3 = 2 pulses
4 = 12 seconds
6 = 30
8 = always active
40 = 100
42 = 100
80 = LED inactive

Happy to get feedback on them!

@primarypete Thanks! I am going to give your settings a shot on my kitchen motion sensor and see what I get. Here is what I using on my other motion sensors:

1 = 10
2 = 15
3 = 2 pulses
4 = 12 seconds
6 = 30
8 = always active
9 = 200
12 Basic on & Basic off
14 = 255
16 = 0
20 = 15
22 = 30
24 = Vibration
26 = 0
40 = 50
42 = 180
60 = 10
62 = 900
64 = 0
66 = 0
80 = Long Blink then short blink
81 = 50
82 = 100
83 = 1000
86 = 18
87 = 28
89 = LED indicates tamper alarm

I will let you know what kind of activity that I get. With the settings above (40 & 42) I am getting frequent lux value changes. Sometimes as much as 4 lux values changes in one minute. The values where 65, 64, 63 & 70, all within a minute. I am hoping this will reduce some of the traffic/noise while still giving me reasonable reporting intervals for lux lighting.

Put the Fibaro outside, then have a look at autoDimmer to manage the levels.

Cheers Mike I’ll give it a whirl!

1 Like

This has been great so far on my kitchen motion sensor. I am going to use these settings for the rest of my motion sensors. Thanks!

The SmartWeather Station Tile device Handler will give you lum for your location. And you don’t have to change the batteries… A big plus in winter in Minnesota.

Go into the IDE and add the device handler from a template then just scroll down and pick it from the list. then add a device for it in the IDE. You tell it your zipcode (or a weather underground station id).

Before this I had a motion sensor in the garage that I normally didn’t have to worry about having a light on or near and a window.

You also have to use Pollster to get it refreshed automatically but I needed that for my Nest thermostats anyway.

Thanks so much for the reply @dmw999 I’ve followed everything (fairly novice-ish at this!)

And the only issue I came across was at the very final stage!

IE In Pollster, under ‘Select devices to be refreshed’ it doesn’t have the virtual device I created. Just a list of my actual devices. It definitely exists as it is listed as a device in the ‘Things’ list.

Any ideas? @geko I’m in the UK - hoping that doesn’t make a difference…

Your device type must declare either ‘Poll’ or ‘Refresh’ capability in metadata section.

thanks! Got it! :smile:

In my device handler for the SmartWeather Station Tile I have:

	capability "Sensor"
	capability "Polling"

I don’t remember adding the polling one but perhaps I did. Sorry.

Wouldn’t it be simpler to just have the motion detection apply between sunset and sunrise? That is supported in the Smart Lighting, I believe.