Event trigger vs Luup code

I need some clarification here (please) on how events and luup code interact in a Scene:

I have a simple Scene with an Event set to trigger if the brightness from an HSM100 < 60 (getting dark)
The command is to turn on a light switch.
I added Luup (Lua?) code to return “false” if the current time is before or after a certain “active” time

The “active” time code works - the light never changes except during the active time
BUT the Event test of “< 60” does not appear to work, the scene executes (ie triggers the light) any time during active time that the HSM100 light value changes, as if the change in value triggers the scene rather than the Event test of “<60”

Example: we enter the active time, the light value changes from 100 to 98, bam - the light goes on!

Question(s): Is this behavior correct? Why does a change in the tested light value constitute an Event rather than the actual Event test of “< 60”? Or… am I dumb and doing it all wrong? :-\

As a workaround, you could check the light level with luup.variable_get …

Thanks Ap15e (catchy name!) for the reply, I had already done that before posting these questions. I will test it later by graphing the sunset light level vs time vs the moment the light turns on, which is how I discovered it was ignoring my “< 60” event trigger and acting instead on any light level change within the Luup-determined time window.

For future reference I am hoping someone can explain this defined-trigger vs code anomoly, or if it is correct behavior, and/or how to properly use “Event” conditionals. Or any other information on this odd behavior.

If the diagram at http://wiki.micasaverde.com/index.php/Luup_Scenes_Events#Adding_Lua_code_to_scenes_and_events is correct (I think so), the behaviour you describe seems to be a bug, which might be related to http://bugs.micasaverde.com/view.php?id=693.