Archive for April 26th, 2014

Vera Micasa Verde – Setting the scene

One of the great features of the Vera Lite unit is the flexibility it offers. Basic functionality is easily acheived using the Scene/Trigger functions (which as it suggests sets out “what” happens – Scene, and “how” it happens – Trigger.).

Examples of this in my system presently include;

  • At Dusk +/- 30 minutes turn the front porch light on.
  • When garage door opens turn on interior lights (when door closes turn off interior lights)
  • Turn on exterior outlets at dusk and turn them off at 10:00pm (this is our Christmas lights, garden lighting circuit).
  • Lock the front door when the alarm system is armed / Unlock when disarmed.

The appeal however is in the more detailed “scripting” options that Vera offers for less immediate or directly related events.

My first “script” (or Lua code) was to prevent the front door from unlocking when we are home, and just turning off the alarm in the morning when we get up (from “stay” mode to “disarmed”).

This took a bit of thinking, and I used the “Ping” app to sort it out. The system will poll both of our cellphones (to see if we are logged in to the local Wifi), if either phone is present then the front door now stays locked when we disarm the alarm. If neither phone is present it unlocks the front door and turns on some interior lights (assuming one of us is just getting home).

After a few hours of tampering with things I’ve managed to figure this part out;

local allow = true
local status = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1","Tripped",50)
return ((status == "1") == allow)

I’m only halfway there. It presently checks to see if Lisas cell phone is logged in. Clearly I’ll have to look over the if/else/then portions of this.

Still….progress? Yeah.