Serval scenes or triggers with luup code ?

Hey

This is more a general question.

It it “better” to have multiple scenes for different actions or a single scene with multiple triggers.

There is no real need of starting the scene manually.

I created a single scene with no action
And added serval triggers with different luup code.

So i have only one scene button, but different actions based on the triggers.
The scene itself has no action at all.

Or is it better to have different scenes with scene luup code and empty trigger luup code?

Micasaverde designed MiOS with the intention that you’d have small, targeted scenes. If you work against that philosophy you will occasionally find yourself swimming against the tide.

That said, you can use a screwdriver as a hammer if it gets the job done.

thats exactly why i asked this … because i did not know about the philosophy and the target.

so having a scene for each action/trigger is the more preferred way then ?

the advantage i see with using a single scene is that there are no useless scene buttons (i have not yet figured out how to hide “internal scenes” from beeing show.

For event driven automation – Using a single scene is fine. I did this before I created the PLEG plugin.
For independent events, the code is all in the Trigger’s LUA code.
For multi-event logic, the code is in the Scene’s LUA code.

occasionally find yourself swimming against the tide
If you can walk [b]and[/b] chew gum at the same time you fall into this category as far as MCV is concerned. They have [b]NO[/b] support for dealing with events other than the [b]Logical OR[/b] of all the Scene triggers unless you use LUA code. The most basic automation scenario people have, turning on a light on motion when dark .. can not be handled by Vera without LUA code. [hr] PLEG was designed to address your needs ... without using LUA coding.

:stuck_out_tongue:

looks like we pretty much on the same page.
well i actually prefer the luup code … the million plugins and buttons give me a great headache.
i have startet to also have normal on/off actions in luup its just more easy to see if all the action is on the same page.

abut my multi-trigger->OneScene … i give the scene a straight forward function now:

  • all “trigger-luup” do return false (because they do the own actions)
  • exept for the last one, its “light off” code in the scene luup …
    by this way it makes more sense … and i have a “scene button” actually doing somethings too :wink:

by the way (abit offtopic)
it seems like i can not define local variables again in a function ?
or do i do somethings wrong ?
i have a delayed function, but its have to check if the status has changed while the waiting time.
but somehow
local blah = luup.variable_get(blah)
always return nil value error

luup.variable_get is for accessing persistent Vera Device variables.
It has nothing to do with the lexical scope of LUA variables.

I figured it out.
I just think “too much php” :slight_smile:

Getting the variable again returns the current data.