Scene calls a scene .. delayed actions canceled

i have a “problem” i experience only if delays happen and a scene calls another scene … it apears that all pending action from the previous scene going down the drain by this.

example: i have my AWAY OFF Scene … which actually has a large block of luup code.
everything works just perfect.
however in some situations this scene does call another scene which does other things …
simply my “start work” scene is called if iam comming back home but my wife has late shift …
so the start work will additional to the away off also start the airconditioner upstairs and prep the hifi system and so on … not really hard things to do …

however, the away OFF is supposed to Unlock the door connecting the garage with the house …
and in 7 out of 10 times the lock stays locked.

it apears that since the lock is battery powered … the vera waits for it to wake up which usally take about 1 sec, but in the meanwhile the other scene is called which executes a new set of z-wave commands …
and the lock simply stays locked.

any idea how to work arround this, without adding a timer?
(it works if i use a timer … but thats just BAD)

It would be interesting to see your code. I do not observe this problem myself.

Note though that if what you are doing causes a Vera reboot, all scheduled (delayed) stuff is lost. Maybe you are causing a Vera reboot?

The lock stay locked if i Not use a timer.

It works with a delay, but thats somethings i’d like to avoid.

I run another scene as well but this one has no z-wave action, so i suspect this has somethings to do with the z-wave command queue

code (part)

luup.log("Scene 16: Away OFF")
-- 16 daynight Module (1 = tag)
local lul_tmp = luup.variable_get("urn:rts-services-com:serviceId:DayTime", "Status", 16)
if (lul_tmp == "0") then
  -- TV backlight 62 (100%)
  luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },112)
  luup.call_action("urn:upnp-org:serviceId:Dimming1","SetLoadLevelTarget",{ newLoadlevelTarget=98 },112)
  -- back light 47
  luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },47)
  if (luup.variable_get("urn:dcineco-com:serviceId:MSwitch1", "Status4", 3) == "1") then 
    -- yui hat spaetschicht
    -- fan licht
    luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },130)
  else
    -- kuechenlicht an
    luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },76)
  end
end

-- power kueche immer an
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },71)

-- tv draussen nach 10 miuten aus machen
luup.call_delay( 'switch_off16', 600)

-- dis arm door sensor 58
luup.variable_set("urn:micasaverde-com:serviceId:SecuritySensor1", "Armed", 0, 58);

function switch_off16()
  -- backlight off
  luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },47)
  luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },112)
end


local pStart = "12:30"   -- Start of time period
local pEnd = "22:00"     -- End of time period
local allow = false
local hS, mS = string.match(pStart,"(%d+)%:(%d+)")
local mStart = (hS * 60) + mS
local hE, mE = string.match(pEnd,"(%d+)%:(%d+)")
local mEnd = (hE * 60) + mE
local tNow = os.date("*t")
local mNow = (tNow.hour * 60) + tNow.min
if mEnd >= mStart then
     if (mNow >= mStart) and (mNow <= mEnd) then
       allow = true 
     end
end

local sAway = tonumber(luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 61), 10)
local s3 = tonumber(luup.variable_get("urn:dcineco-com:serviceId:MSwitch1", "Status4", 3), 10)
if (allow == true) and (s3 == 1)and( sAway == 0) then
	-- yui spaet, zwiwschen 13 und 22 uhr, away aus 
	-- autostart work scene
	luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "38"}, 0)
end

-- transmission alt-speed speed
luup.inet.wget('http://172.16.67.21:8000/?script=transmission-alt-speed.sh', 5)


strSMS = "WaiKiki: DisArmed"
strSendMario456 = true
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum = "32"}, 0)
return true

very straight forward everything

scene 32 always runns (it just send me a Push notification to the phone that disarm did happen)
so that proof the vera does not restart, as its the last action

scene 38 does set some lamps (if night)
turn on the Aircon in the office and set the Amplifier also nothing fancy

if i add a start delay or comment out the start of scene 38 … the lock does work
if it runns … the issue does occour 7 out of 10 times

Thanks for showing the code. I admit I do not see anything yet.

My suggested next step is to examine the Vera system log, and see what it says.

Another possible thing to try is to put “kwikLog” statement calls throughout your code, including the scenes that get invoked. That would show if the scenes are being run or not. (kwikLog is described in the “Conditional Scene Execution” sticky thread at the top of this subforum.)

I think its time to enable debug then :stuck_out_tongue:

The scenes do run (i see the outputs like airconditioner has turned on and so)

I noticed the vera attempt to talk to the lock (blue status) and every time it does happen the vera simply do not re-try sending the unlock command at all.

Sent from my iPhone using Tapatalk