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.

One comment

  1. Mugwug says:

    The “occupancy” issue is a real issue.

    “ping” proved unreliable, it liked the blackberry (rock solid response) better than my android (50% fail), and as such was sort of “Meh” in telling whether we are home or not.

    I went a different route on this. I took one of the Wemo outlets I was not using and plugged it in in the network closet. I have the system turn the switch on when we disarm the alarm system, the system DOES NOT change the outlets status when we arm the system to “stay”, and turns the light off when we arm the system to “away”.

    Different scenes check the status of that outlet and trigger events based on whether or not we are home, additional events may be triggered if it is night AND we are not home etc etc etc.

    Obviously I can use a “virtual switch” to accomplish the same thing rather than an actual switch, but this way I can glance at the outlet as I walk by and confirm it has worked properly.

    Seems to be working good so far.

Leave a Reply

Your email address will not be published. Required fields are marked *