Scene Controlled Mode

I’m able to change the mode of my DSC alarm panel when Vera mode is changed (Away/Home/Stay/Vacation). Now, I’d like also to be able to update my Vera mode when the Alarm Panel Mode is changed.

Is there a way to create a scene to change the mode ? I can trigger a device but not a Mode.

Put this one line of LUA code in your Scene that is triggered by the Alarm. Works like a charm. Copy and paste the line of code into your scene Lua field depeding on the mode you are trying to set:

To Set Mode Night add

luup.call_action(‘urn:micasaverde-com:serviceId:HomeAutomationGateway1’, ‘SetHouseMode’, { Mode=3 }, 0)

To Set Mode Home add

luup.call_action(‘urn:micasaverde-com:serviceId:HomeAutomationGateway1’, ‘SetHouseMode’, { Mode=1 }, 0)

To set Mode Away add

luup.call_action(‘urn:micasaverde-com:serviceId:HomeAutomationGateway1’, ‘SetHouseMode’, { Mode=2 }, 0)

Thank you shallowearth. Works great!!!

Do we need to keep an account with EyeZon? As I can control my EZ4 with Vera, I don’t see the need to keep an open link to my security system. I don’t like the fact that you can access just with a link, no password.

[quote=“shallowearth, post:2, topic:189742”]Put this one line of LUA code in your Scene that is triggered by the Alarm. Works like a charm. Copy and paste the line of code into your scene Lua field depeding on the mode you are trying to set:

To Set Mode Night add

luup.call_action(‘urn:micasaverde-com:serviceId:HomeAutomationGateway1’, ‘SetHouseMode’, { Mode=3 }, 0)

To Set Mode Home add

luup.call_action(‘urn:micasaverde-com:serviceId:HomeAutomationGateway1’, ‘SetHouseMode’, { Mode=1 }, 0)

To set Mode Away add

luup.call_action(‘urn:micasaverde-com:serviceId:HomeAutomationGateway1’, ‘SetHouseMode’, { Mode=2 }, 0)[/quote]

Thanks for the code for setting the house modes…

Here is one question that I’m figuring right now… How can I add an additional delay (on top of the delay that’s part of the changing scenes)?

My thought is this. At the top of my stairs, I have a 7 button Z-Wave controller that is hard wired. The big bottom button is programmed to a scene called “Bed Time”. In a past life when I used Homeseer, this was fairly straight forward, but with Vera, I’m still going thru the learning curve. During “Bed Time” I turn on x, y and z lights in my master bedroom and bathroom, I delay 10 minutes (time to brush the teeth and do the nightly routine and crawl into bed), after 10 minutes, my wife and I are in bed and then the lights turn off…

How can I add the 10 minute delay before the luup.call_action(‘urn:micasaverde-com:serviceId:HomeAutomationGateway1’, ‘SetHouseMode’, { Mode=3 }, 0)

I tried different delay functions and I keep getting lua errors.

thanks!
Stephen

In LUA … you need to use luup.call_delay with the NAME of a GLOBAL function to be called at the specified delay.

NOTE: That you pass the NAME of a function, and the function has to be global to be found when the timer expires.

This is a lot easier for casual programmers in PLEG.

I was able to get the delay to work, but does anyone know if there is a time limit to the delay function? I wanted to set around 600 seconds (10 minutes)

Thanks!
Stephen

If you use luup.call_delay there is no limit … If you use other timer types you will block Vera and it will restart.