Log vs Notification for motion sensor

Hi all,

I have a Vera3 (UI7) hooked up to my DSC alarm system via the DSC plug-in and an Envisalink 3 card. I would like to monitor my upstairs motion sensor to record the date/time of motion without any specific action being taken (i.e.: no scenes to run). I just want to be able to look at the it via the Vera3’s UI and see the last few times it has been triggered. Is this possible to do?

Here are a couple of things I tried:

  1. Armed the sensor in hopes it would generate logs under device → Logs. It didn’t.
  2. Tried creating a scene, but it doesn’t allow me to enter no action.
  3. Enabled notifications for under device → notifications for “Whenever Upstairs Motion Sensor detects motion whether is armed or disarmed”. I didn’t check any of the check boxes near the users as all I wanted was to generate a log entry.

I’m using #3 right now, but I keep getting notification e-mails every 30sec while the sensor is detecting movement. Reporting once every 1-3 minutes would be enough for me. Ideally I would like to limit the time window the sensor would log movement (e.g.: say, between 11pm and 7am).

Would that be possible? What are my options?

Thanks!

You could create a scene that is triggered by the motion sensor and place the following code in the Luup Code tab:

[code]local function kwikLog(message, clear)
local socket = require(“socket”)
local time = socket.gettime() or os.time()
local tms = string.format(“.%03d “,math.floor (1000 * (time % 1)))
local stamp = os.date(”%d %b %Y %T”,math.floor(time)) … tms
local mode = “a+”
if clear then mode = “w+” end
local file = io.open(“/www/kwikLog.txt”, mode)
file:write(stamp … (message or “”) … “\n”)
file:close()
end

kwikLog(“Motion Detector Tripped”)
[/code]

This will create a log that you can view with the browser command: /kwikLog.txt replace with the IP address of your Vera.

See kwikLog for more details.

You can use PLEG to limit and trottle the alerts:

PLEG Input Schedule:
NotifySchedule On Every Day (or days of interest) at 11:00PM and off at 7:00AM

INPUT Trigger
Motion When (armed ?) motion detector detects motion.

Condition:
MotionAlert NotifySchedule and (MotionAlert; Motion > 5:00)

You have various options for notification:

  1. Notification on PLEG when it satisified MotionAlert, Using Vera’s notifications, or maybe using the Vera Alerts Plugin.
  2. Advanced Tab, of action, send alert to a notification plugin … (i.e. Vera Alerts, Sonos, Homewave, …)
  3. Use LUA for action to do a kwiklog.

[hr]
The expression:
MotionAlert; Motion > 5:00
Will be true if the Motion is at least 5 minutes since the last MotionAlert

NOTE: If this is a battery powered motion sensor you will want to configure it to quickly indicate no motion. Otherwise if it’s busy … you will only get one alert and not more until motion detection becomes idle.

Thanks to you both. Learned 2 new things today.

I like the PLEG idea to throttle things. I’ll try that first. This is a wired device, so it should be ok, right?

The kwiklog idea is also good, but to me it would be better if I could convince Vera3 to list the entries under device → Logs. Do you guys know if this is possible?

Also, what’s the meaning of “armed” here? Does it mean my alarm system is armed? But the device that represents the alarm (the partition device) also has a “armed” button. Not sure why each one has an “armed” option in it.

Thanks!