We have moved at community.getvera.com

Author Topic: Newby question on scene triggers  (Read 1555 times)

Offline activ

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Newby question on scene triggers
« on: March 06, 2013, 10:59:01 am »
Hi all,

I hope I'm posting this in the right topic, if not please move to wherever is appropriate.

I just got my first Vera (2) and am trying to get to grips with how it all works and what the possibilities are.
I'm starting to find my way a bit now and have run into something that I don't understand how to do.
There are several varieties, but what it boils down to is this:
I can set a sensor to trigger a scene and for instance switch on a light when motion is detected by a sensor, but I don't want to switch the light on when it's not dark.
This means that the logic would be:
Is it dark? No -> End
            Yes -> Is there movement? Yes -> Light on
                  No -> End

I can't seem to figure out how to do this (I do have a sensor to determine if it's light and one to determine motion)

Hope you guys can help me get my head around multi-variable triggers like the above, if it needs more clarification please let me know.

Thanks in advance for the help.
   

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Newby question on scene triggers
« Reply #1 on: March 06, 2013, 11:10:47 am »
Answered many times:
See:
http://forum.micasaverde.com/index.php/topic,13802.0.html

The Program Logic Plugins require UI5.

If you want to do this in LUA code add the following to the LUUP of your motion trigger for your scene:

Code: [Select]
return luup.is_night()

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: Newby question on scene triggers
« Reply #2 on: March 06, 2013, 11:11:35 am »
Using a scene, this is easily accomplished with a refactoring of your logic:

Is there a movement ?
   Yes ->
      Is it dark?
         No -> exit scene
         Yes -> Light on

Specifically:

  • Make a scene to turn on the light
  • Trigger this with a PIR movement detection event (or whatever)
  • Add Luup code to the scene: return (some logical expression which is true if dark)

Your 'is dark' expression could be as simple as checking if it is night time, or, as you say, a threshold on a light level sensor.  If it's false, then the scene is aborted without turning on the light.

I have no doubt that Richard will be along to tell how to do it in PLEG, but these instructions here are the fundamentals of Vera scenes and triggers, which it's always good to know.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline akbooer

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: Newby question on scene triggers
« Reply #3 on: March 06, 2013, 11:13:52 am »
DARN!

Richard beat me to it!   :)
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline activ

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: Newby question on scene triggers
« Reply #4 on: March 06, 2013, 01:22:26 pm »
Thanks for all the answers guys, I'll go and see what they mean now.