APNT-106 - Triggering Vera UI7 Scenes

In this guide we will take an in-depth look at Scene Triggers and the various actions available in VERA UI7.

A Scene Trigger is used to automatically run a VERA Scene.

For instance a motion detector can be used to run (Trigger) a Scene when it is tripped. This Scene could then turn lights on, send you an email notification or raise an alarm - all these actions are controlled within the Scene and activated by just one Trigger from the motion sensor.

Note: for a complete guide on how to create a VERA Scene please refer to APNT-103 - Creating Scenes in VERA UI7

Creating the Trigger

Scene Triggers are created and edited within the VERA Scene wizard.

  • On the first step select ‘Device’ as your Trigger and then click ‘Select a device’

Select a Trigger


  • Select the desired device from the list

Available Triggers

We’ll now take a look at some of the most common device types and explain each of the available Triggers.

Motion Sensor

  • Is armed and detects motion – Scene is Triggered when the sensor is armed and motion is detected
  • Is armed and stops detecting motion – Scene is Triggered when the sensor is armed and motion alarm is cleared
  • Detects motion whether is armed or disarmed – Scene is Triggered whenever motion is detected
  • Stops detecting motion whether is armed or disarmed – Scene is Triggered whenever motion alarm is cleared
  • Battery level goes below – Scene is Triggered when battery level goes below a defined value

Motion Sensor


Humidity Sensor

  • Humidity goes above – Scene is Triggered when humidity value goes above a defined value
  • Humidity goes bellow – Scene is Triggered when humidity value goes bellow a defined value
  • Battery level goes bellow – Scene is Triggered when battery level goes bellow a defined value

Humidity Sensor


Light Sensor

  • Brightness goes below – Scene is Triggered when brightness level goes below a defined value
  • Brightness goes above – Scene is Triggered when brightness level goes above a defined value
  • Battery level goes bellow – Scene is Triggered when battery level goes bellow a defined value

Light Sensor


Temperature Sensor

  • Temperature goes above – Scene is Triggered when temperature goes above a defined value
  • Temperature goes below – Scene is Triggered when temperature goes below a defined value
  • Battery level goes bellow – Scene is Triggered when battery level goes bellow a defined value

Temperature  Sensor


Power Metering Socket

  • A device is turned on or off – Scene is Triggered when device is turned On or Off
  • Energy usage goes above – Scene is Triggered when power usage goes above a defined value
  • Energy usage goes below – Scene is Triggered when power usage goes below a defined value
  • Device energy usage for last 24 hours goes above – Scene is Triggered when the total amount of energy used in the last 24 hours goes above a defined value
  • Device energy usage for last week goes above – Scene is Triggered when the total amount of energy used in the last week goes above a defined value
  • Device energy usage for last 30 days goes above – Scene is Triggered when the total amount of energy used in the last 30 days goes above a defined value
  • Device energy usage for last year goes above – Scene is Triggered when the total amount of energy used in the last year goes above a defined value
  • Lifetime device energy usage goes above – Scene is Triggered when the total amount of energy used goes above a defined value

Power Metering Socket


Door & Window Sensor

  • Is armed and opened – Scene is Triggered when the device is armed and door/window is opened
  • Is armed and closed – Scene is Triggered when the device is armed and door/window is closed
  • Is opened whether is armed or disarmed – Scene is Triggered whenever the door/window is opened
  • Is closed whether is armed or disarmed – Scene is Triggered whenever the door/window is closed
  • Battery level goes bellow – Scene is Triggered when battery level goes bellow a defined value
  • Is being tampered with – Scene is Triggered when the device sends a tamper alert

Door & Window Sensor


Scene Controller

  • A Scene is activated – Scene is Triggered when a defined “device Scene” is activated
  • A Scene is de-activated – Scene is Triggered when a defined “device Scene” is de-activated
  • Battery level goes bellow – Scene is Triggered when battery level goes bellow a defined value
  • Note: refer to the device manual for the available Scene number list

Scene Controller


Multi Triggers

When adding more than one Trigger the Scene will run when either one is Triggered.

For instance, in the below example this Scene will run when motion is detected OR brightness goes bellow 150 LUX


Multiple Triggers


Conditional Triggering

You can add conditional checks to a Trigger to execute the Scene only when certain conditions are met.

This can be achieved by adding some LUA code to the Trigger and returning False when the condition is not met.

Let’s say you want your Scene to be Triggered by a Motion Sensor only when the brightness level is below a certain point.

  • Add your Motion Sensor as a ‘Device Trigger’
  • Select the desired Trigger and click ‘Validate’
  • Click the ‘L’ button and add the necessary LUA code
  • Click ‘Save lua’

Conditional Triggers


Let’s take a quick look at what our LUA code is doing:

  • Start by setting our Light Sensor ID and Maximum Brightness variables
    • Note: make sure to update these values according to your needs
local LightSensorID = 23 local MaxBrightness = 150
  • Read the current Brightness value when the Motion Sensor is Triggered
local Brightness = luup.variable_get("urn:micasaverde-com:serviceId:LightSensor1","CurrentLevel",LightSensorID)
  • Create the condition
    • If the Current Brightness is above the desired value then don’t run the Scene
    • If the Current Brightness is below the desired value then run the Scene
if ((tonumber(Brightness)> MaxBrightness)) then
return false
else
return true
end

Further examples and additional information can be found on Vera’s Forum.

Related Information