Aeotec Multi-sensor Lux setting and RM

Hello - I have the following rule set up and it works EXCEPT if the multi-sensor is giving a reading of "0" lux. Currently, its +120 minutes after sunrise, all the conditions for turning on the lights are showing "T" but the rule did not turn on the lights.

It does work (both on/off) when the reading is <=20 but not when it is "0". I looked at the "events" for the app and the last event was at night (around 10:05 PM, when the lights were turned off). Also, I checked the lux reading on an app on my phone (placed it in the same position as the sensor) and it gave me a reading of 16 lux. The sensor is indoors but pointed towards an open window.

Thanks for your help.

UPDATE: The rule just turned the lights on and the lux reading is now "1", so it does seem that the rule is ignoring the "0" reading (or is not triggering the rule if the reading is "0")

which driver are you using?

That's really interesting considering in your rule above it's actually working. AKA the rule is showing 0 <= 20 as "TRUE" which means the logic is working at some level.

1 Like

Not directly related but you have some superfluous logic in there.


Why check to see if the switch of off before turning it on (or on before turning off)?

Does "Virtual Bookcase Lux" tie back to "Bookcase Lamps" in any way?

1 Like

I'm using @csteele - AeotecMultisensor6 driver. I originally had it on the Hubitat one but needed to change some parameters that were not exposed by the Hubitat driver.

I think what is happening is that the trigger is not executing as there is no change (night reading is "0" lux). I may create a time based automation that executes at Sunrise + 120, checks if Lux = "0" and turns on the light. Thoughts on that?

Virtual Bookcase Lux is not directly tied back to the Bookcase lights. I am logging events to a MySQL database and I use some virtual switches to tell me which automation ran (I can't get app events to be published by MakerAPI). The nested logic is there to just document the event.

I'm trying to create the rule and getting confused by the terminology. I created a Simple Automation that turns the lights on at Sunrise + 120. I added a restriction that is "Lux <=0"

I'm getting confused by how this restriction will work. Does the rule NOT run if Lux <=0 (meaning I need to change the restriction to Lux >=1) or does it run ONLY when Lux is zero or less (what I want)? :thinking:

Events are 'filtered' by the platform. Unless specifically overridden, the platform will not write duplicate Events to the DB. Where duplicate means same value as the last time.

1 Like

Thanks - that's what I figured was happening. I may have a solution (see above) but am getting confused by the restriction logic :flushed:

Instead of using "0" I would use the same condition you are using in your rule. You saw the condition evaluate when it changed to 1, but if it happened to be 1 (or 2 or whatever) before sunrise + 120 it still won't fire until there is a value changed again.

I'm connected to the office VPN so I can't connect to my hub but I believe that the restriction must evaluate to true for the rule to run. So it would be the same logic as your original rule. For example, if you had a restriction that was between two times it would only execute during that time. Hope that makes sense. :wink:

1 Like

If I had to guess (read between the lines :slight_smile: ) of what your Rule is intending.. I'd say you want the LUX values to dictate the light (on/off) between Sunrise+120 and Sunset-120 BUT that you want the light to be correct at both of those times.

It seems like your Triggers should be: Illuminance OR Sunrise+120 OR Sunset-120

That way, all day the light follows Illuminance and then, at each of those critical times, the light gets set to what you intend.

1 Like

Hmm - that's a thought. I could put in an OR trigger Sunrise+120 (I don't need the Sunset - 120 as the lights come on at Sunset - 105 in any case). That way, it would ALWAYS execute at Sunrise + 120. If lux was 0 (no lux trigger), it would still turn on the lights. Thanks!

It does. I think I have a different work around as suggested by @csteele, so I may pause this new rule for now.

rereading this you have nothing to "trigger" the rule at your sunrise/sunset times. If Illlum stays 0 when sunset -120 happens...nothing is going to run.

1 Like

Yep - I’ve added another trigger (Sunrise+120) so it should run at that time and check if Lux <=20, turn on the lights. Once the Lux reading gets > 0, then the Lux based triggers should start working.

The lux based triggers are's just that the lux isn't changing. So it's not going to trigger until the next reported lux level change. The 0 is irrelevant.

Sorry - that’s what I meant. Any change after 0 (transition from night to day) gets triggered

1 Like

True... if the value was changing.. 0 1 0 1 0 then each zero would get the same event processing as each 1. It's the fact that it's reporting 0 0 0 0 and there's no change. 4 4 4 4 would get the same lack of additional Events. :smiley: