scene seem not to run trough ..

hey … maybe i do miss somethings.

i have 1 scene (doing nothing much serious)
its triggered by deviceID77 turned on(which is a physical switch used to shut down things before leave or sleeping)

here is the code: http://0x8.in.th/tmp/scene20.txt

it happens in 4 out of 10 times that the switch (id 77) does stay on … no clue why that may is.

anyone have some idea ?
maybe timing ?

the scene is supposed to turn off the switch on the end (with a delay).
the status of the switch is used later for other things (like arming the house) … but if its never get back off … this turns out to be some sort of “problem”

maybe someone has better eyes than me :stuck_out_tongue:

Don’t use luup.sleep, try luup.call_timer instead.

The sleeps are just to make sure commands are not beeing send too fast.

For the delayed actions i use call_delay (as the delay is based on the scene itself (not at a certain time)

Since about 2 days i do have the same issue with another scene where some call_delay never beeing called at all.

I’ve read before that luup.sleep prevents all other luup-code from running (while sleeping), even code from other scenes. Maybe it’s not causing your problems, but it’s just best not to use the sleep function at all I guess…

I too have read somewhere in the wikki that sleep command causes issues so I too have avoided it however I am interested now to know if the luup.call_delay also delays all other lua scripts while it is ‘delaying’ - as if so this makes sense as to why I may be suffering issues:

http://forum.micasaverde.com/index.php/topic,17676.0.html

interested to know if any one can confirm if luup.call_delay suffers from the same issues as found with sleep?

I am interested now to know if the luup.call_delay also delays all other lua scripts while it is 'delaying'

No … it’s like a fire and forget missile … This starts a delay … and at some point in the future the code will run. The existing LUA code continues immediately to the next line after the call to luup.call_delay. Call it twice … and it’s like launching two missiles.

Sleep is indeed a bad aproach.

I noticed that if i trigger the same scene via homewave app
After doing so the tablet disconnects, and if i reload immideatly i get a connection error

Luup.sleep seems to be more like a coma rather than sleep :slight_smile:

Luup.sleep seems to be more like a coma

With my analogy … sleep is more like encountering a land mine!

@RichardTSchaefer - thank you - you are like my mentor today :wink: thought I may have found another line of enquiry for my troubles but no cigar! ::slight_smile:

Onto the next search for information… ;D