We have moved at community.getvera.com

Author Topic: UI7 using AND in scene  (Read 4148 times)

Offline remcoploeg

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
UI7 using AND in scene
« on: October 25, 2014, 04:46:01 am »
Hello,

I am using Fibaro HC2 and try to move to Vera. One of the strange things I have seen with the UI7 is the total missing of using an AND in scenes. Is this not possible? I want to have for an example when movement is detected AND the Lux is below 40 then switch a light on. I don't hope that I need LUUP code to do that? This are really the basics..... but maybe I am missing an option :)

Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: UI7 using AND in scene
« Reply #1 on: October 25, 2014, 05:31:12 am »
Yes, Vera assumes a OR between triggers. Using luup, you can implement a AND.

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: UI7 using AND in scene
« Reply #2 on: October 25, 2014, 05:44:27 am »
Using Lua to implement an AND function in scenes is not that difficult. See Conditional Scene Execution for an explanation and some examples.

Offline remcoploeg

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: UI7 using AND in scene
« Reply #3 on: October 25, 2014, 06:13:54 am »
I have spent some hours of LUA in Fibaro, but I don't get the mechanism of the UI7. In Fibaro HC2 you can select between UI and Lua code. I see only the graphic option, with on the end to add LUUP code. I have checked the conditional scene execution, but I can't find any good sample how to do this. Sorry I am really a newby on Vera... 

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-12
Re: UI7 using AND in scene
« Reply #4 on: October 25, 2014, 06:34:18 am »
I have spent some hours of LUA in Fibaro, but I don't get the mechanism of the UI7. In Fibaro HC2 you can select between UI and Lua code. I see only the graphic option, with on the end to add LUUP code. I have checked the conditional scene execution, but I can't find any good sample how to do this. Sorry I am really a newby on Vera...

Vera does not work the same way as HC2. In HC2 scenes are coded in Lua but it provides a graphical interface to create the Lua for simple logic and you can then edit/extend the code for more advanced requirements.

In Vera, the graphical configuration of scenes does not produce Lua code. Lua may be added to a scene to control whether it runs or not. You may also create a scene with no graphically-defined actions and add Lua to  implement those actions instead.

Your requirement to turn on a light when a motion sensor trips and the light level is below 40 lux is not too difficult. Create the scene to turn on the light when triggered by the motion detector. Add Lua code to allow the scene to run only when the light-level is below 40 lux. See Light Level for the code.
 

Offline Silverow

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +1/-1
Re: UI7 using AND in scene
« Reply #5 on: October 25, 2014, 07:15:53 am »
Or you may use PLEG, when it will work on UI7

Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: UI7 using AND in scene
« Reply #6 on: October 25, 2014, 07:39:57 am »
The Combination virtual switch plugin could probably be a solution for that too: http://forum.micasaverde.com/index.php/topic,10995.0.html

Offline Don Diego

  • Hero Member
  • *****
  • Posts: 534
  • Karma: +300/-3
Re: UI7 using AND in scene
« Reply #7 on: October 25, 2014, 07:43:06 am »
Or you may use PLEG, when it will work on UI7

Hi Silverow

  Please see the following link for the status of the various plugins (including PLEG).

http://forum.micasaverde.com/index.php/topic,26438.msg187414.html#msg187414

Don
Vera 3 (@1.5.622) (3); Vera Plus (2);
Trane/Schlage TStats (1); Schlage Deadbolt (2); Kwikset Lock (3);  GE 45602 Dimmer (14); GE 45603 Dimmer (17); HSM-100 (16); Everspring Siren (8), Everspring Temp/Humidity (4); HSM 200 (1)