If sensor is tripped after certain time.

Hi,

Need some help with a scene. I got a door sensor and I want a notification if its tripped at a certain time…

Thanks

have a look at the PLEG on this forum…many examples where how you can do this.

http://wiki.micasaverde.com/index.php/Luup_Scenes_Events#Access_the_current_time

Example on that page to use:
Do something between 16:00 and 21:15:

[code] local t = os.date(‘*t’)
local current_second = t.hour * 3600 + t.min * 60 + t.sec – number of seconds since midnight
local min_time_in_seconds = 16 * 3600 + 0 * 60 – 16:00
local max_time_in_seconds = 21 * 3600 + 15 * 60 – 21:15

if (current_second > min_time_in_seconds) and (current_second < max_time_in_seconds) then
– do something
else
return false
end[/code]

Change ‘-- do something’ to ‘return true’, and send the notification from that same scene. it will then only send your notification if the scene is true

also some good LUUP here - I am still old school and like the code ::slight_smile:

http://wiki.micasaverde.com/index.php/Scripts_for_scenes

Thanks!
Will try it when I get home from work!

Read the wiki and got it to work perfect.
Thanks!