Author Topic: Lux Level trigger to retrigger within time  (Read 273 times)

Offline thistle2015

  • Newbie
  • *
  • Posts: 9
  • Karma: +1/-0
Lux Level trigger to retrigger within time
« on: March 06, 2017, 11:37:53 am »
Hi,
I have a scene triggered by the time of day and Lux Level of 0-5. This switches on my Kitchen light and then switches it off after 15mins. The scene runs fine, but If I?m in the kitchen whilst the scene is running the Lux level is higher (around 17 Lux) therefore although the sensor detects I?m in the kitchen the scene doesn?t ?re-run? because of the light level.

I was just wondering how I could say : ignore the lux level after first being activated or maybe ignore it for 15Mins? I don't know the proper luup code language for such a request.

It uses the following code inserted in the trigger part:
 
local dID =284         
local lLow = 0         
local lHigh = 8       
local allow = true     
local lCurrent = tonumber((luup.variable_get("urn:micasaverde-com:serviceId:LightSensor1","CurrentLevel",284)))
return (((lCurrent >= lLow) and (lCurrent <= lHigh)) == allow)
 

Offline rge

  • Jr. Member
  • **
  • Posts: 90
  • Karma: +9/-0
Re: Lux Level trigger to retrigger within time
« Reply #1 on: March 06, 2017, 12:10:49 pm »
By "inserted in the trigger part" what do you actually mean - you can't insert code into a trigger.

You mean it is in the Luup code to execute I would guess, and returning false if it's bright stops the light turn-on.

So what are you using as the trigger - a motion sensor?

Does the motion sensor have a "stopped detecting motion" event?  You can probably use that instead, because it probably doesn't send it until it hasn't detected any motion for your specified time, rather than a fixed time as you have at the moment.

I do this and it works fine (Zooz/Cyrus 4-in-1 sensor) - just set the turn off time to 15 minutes. Or less, since it will be more based on movement than the current solution.

Offline thistle2015

  • Newbie
  • *
  • Posts: 9
  • Karma: +1/-0
Re: Lux Level trigger to retrigger within time
« Reply #2 on: March 11, 2017, 07:45:45 pm »
Hi rge,
I've inserted the code in the Trigger Luup Event.
I'm using a Fibaro FGMS-001 Multisensor Motion Sensor.

Could you send me what you have for your sensor, so I can have a try please?

Thanks