This is my garage door auto close logic using Vera Home Z-Wave home Automation to DriveWay Motion Sensor
* Warns garage is open at 5 minutes (regardless of motion) on the TV (WMC) and over the whole home audio (Text to Speech (TTS) running on WMC)
* Warns garage is open at 10 minutes (regardless of motion) via TTS and WMC
* Warns garage is open at 14 minutes AND if no motion is detected in the driveway for more than 14 minutes that garage will be closed
* Warns garage is open at 15 minutes via TTS and WMC and closes after playing a small Z-Wave siren (covered with tape to muffle sound to keep the decibals down) for 2 seconds x 3 times.
Note - My motion sensor has a 4 minute timeout from the Motion to !Motion (Not Motion). YMMV
Specific Vera/PLEG logic below. It also does a lot more like (turn on the lights when entry door to house is opened and turned off when no motion inside the garage for 10 minutes)...but I just showed the garage door logic that may be convertible logic to your Elk panel.
Triggers
Name
Description
ENT_Driveway_Motion
ENT - Driveway Motion armed is tripped
GRG_Overhead_Door_Open
GRG - Overhead Door Open armed is tripped
Conditions
Name
Repeat
Expression
GRG_Overhead_Door_Open_Alert
No
GRG_Overhead_Door_Open
GRG_Overhead_Door_Closed_Alert
No
!GRG_Overhead_Door_Open
GRG_Overhead_Door_Open_5min
No
GRG_Overhead_Door_Open and (GRG_Overhead_Door_Open ; NOW > 5:00)
GRG_Overhead_Door_Open_10min
No
GRG_Overhead_Door_Open and (GRG_Overhead_Door_Open; Now > 10:00)
GRG_Overhead_Door_Open_14min
No
GRG_Overhead_Door_Open and (GRG_Overhead_Door_Open; Now > 14:00) and (!ENT_Driveway_Motion; Now > 10:00)
GRG_Overhead_Door_Open_15min
No
GRG_Overhead_Door_Open and (GRG_Overhead_Door_Open; Now > 16:00) and (!ENT_Driveway_Motion; Now > 12:00)
LUA for Condition: GRG_Overhead_Door_Open_Alert
local status, result = luup.inet.wget("
http://192.168.0.100:8080/record?ot=2&oid=7", 5)
local ttsMsg = "Outdoor Sensor Warning,, The Garage Overhead Door has been Opened"
local wmcTitle = "Outside_Motion"
local wmcMsg = "The Garage Overhead Door has been Opened"
host = "192.168.0.100"
local socket = require("socket")
local udp = socket.try(socket.udp())
socket.try(udp:sendto("VC.TriggerEvent&&Intercom", host, 33000))
luup.sleep(500)
socket.try(udp:sendto("tts.speak&&" .. ttsMsg, host, 33000))
luup.sleep(500)
socket.try(udp:sendto("VC.TriggerEvent&&HoloDeck", host, 33000))
luup.sleep(100)
tcp = assert(socket.connect(host, 40500))
tcp:send("msgbox \"" .. wmcTitle .. "\" \"" .. wmcMsg .. "\" 8")
tcp:close()
LUA for Condition: GRG_Overhead_Door_Closed_Alert
local status, result = luup.inet.wget("
http://192.168.0.100:8080/recordstop?ot=2&oid=7", 5)
local ttsMsg = "Alert,, The Garage Overhead Door has been Closed"
local wmcTitle = "Alert"
local wmcMsg = "The Garage Overhead Door has been Closed"
host = "192.168.0.100"
local socket = require("socket")
local udp = socket.try(socket.udp())
socket.try(udp:sendto("VC.TriggerEvent&&Intercom", host, 33000))
luup.sleep(500)
socket.try(udp:sendto("tts.speak&&" .. ttsMsg, host, 33000))
luup.sleep(500)
socket.try(udp:sendto("VC.TriggerEvent&&HoloDeck", host, 33000))
luup.sleep(100)
tcp = assert(socket.connect(host, 40500))
tcp:send("msgbox \"" .. wmcTitle .. "\" \"" .. wmcMsg .. "\" 8")
tcp:close()
LUA for Condition: GRG_Overhead_Door_Open_15min
local ttsMsg = "Warning,, the Garage Overhead Door has been opened for 15 minutes with no motion. I will close it now. Please clear the garage door area."
local wmcTitle = "Garage_Door"
local wmcMsg = "Garage Overhead Door has been opened for 15 minutes with no motion. I will close it now. Please clear the garage door area."
host = "192.168.0.100"
local socket = require("socket")
local udp = socket.try(socket.udp())
socket.try(udp:sendto("VC.TriggerEvent&&MainScreen", host, 33000))
luup.sleep(500)
socket.try(udp:sendto("tts.speak&&" .. ttsMsg, host, 33000))
luup.sleep(100)
tcp = assert(socket.connect(host, 40500))
tcp:send("msgbox \"" .. wmcTitle .. "\" \"" .. wmcMsg .. "\" 8")
tcp:close()
Actions for Condition: GRG_Overhead_Door_Open_15min
Immediate
Device
Action
Arguments
Siren
SetLoadLevelTarget
newLoadlevelTarget=20
Delay 05
Device
Action
Arguments
Siren
SetLoadLevelTarget
newLoadlevelTarget=100
Delay 07
Device
Action
Arguments
Siren
SetLoadLevelTarget
newLoadlevelTarget=20
Delay 10
Device
Action
Arguments
Siren
SetLoadLevelTarget
newLoadlevelTarget=100
Delay 12
Device
Action
Arguments
Siren
SetLoadLevelTarget
newLoadlevelTarget=20
Delay 15
Device
Action
Arguments
GRG - Overhead Door
SetTarget
newTargetValue=1
Siren
SetLoadLevelTarget
newLoadlevelTarget=100
Delay 20
Device
Action
Arguments
Siren
SetLoadLevelTarget
newLoadlevelTarget=0
LUA for Condition: GRG_Overhead_Door_Open_14min
local ttsMsg = "Warning,, the Garage Overhead Door has been opened for 14 minutes with no motion. I will close it in 1 minute unless motion is detected."
local wmcTitle = "Garage_Door"
local wmcMsg = "Garage Overhead Door has been opened for 14 minutes with no motion. I will close it in 1 minute unless motion is detected."
host = "192.168.0.100"
local socket = require("socket")
local udp = socket.try(socket.udp())
socket.try(udp:sendto("VC.TriggerEvent&&MainScreen", host, 33000))
luup.sleep(500)
socket.try(udp:sendto("tts.speak&&" .. ttsMsg, host, 33000))
luup.sleep(100)
tcp = assert(socket.connect(host, 40500))
tcp:send("msgbox \"" .. wmcTitle .. "\" \"" .. wmcMsg .. "\" 8")
tcp:close()
Actions for Condition: Garage_Auto_Lock
Immediate
Device
Action
Arguments
GRG - Foyer Door Lock
SetTarget
newTargetValue=1