scenes containing LUA code do not run (man. triggered) but they do in test code

Up to a few weeks ago, my alarm setup was functionning perfectly. Then I started to have it going off when leaving and arming. I use a scene to reset the tripped status. (don’t want to wait to re-enter the home if I forget something)
Asked for support and got it, but no real answer. Some devices lost spontaneously their trigger states and thus were not launching scenes. Had to redo the triggering part (case lock on keypad do something)
next problem:
I cannot not succeed in using my scenes in a script. Nothing is happening.
Now i fiddled a bit with my scenes, and I notice that in fact a scene, manually triggered, with only a luacode in, doesn’t function when clicking on play (it did in past!). When I cut the code from the scene and paste it in the lua developper test window, it is doing what is asked. It seams lua code is not functionning when in scenes…

I’m getting crazy here…did a reboot twice at no avail…

Do I have to redo my complete setup (factory reset, include devices and start over all my scenes and scripts? or is there any hope somewhere?

Would be helpful if you would post an example. The only times I have seen this happen is when I had conditionals not met in the scene. The scene editors also has some embedded conditionals like (house mode)

[quote=“OlivierToebosch, post:1, topic:198657”]I cannot not succeed in using my scenes in a script. Nothing is happening.
Now i fiddled a bit with my scenes, and I notice that in fact a scene, manually triggered, with only a luacode in, doesn’t function when clicking on play (it did in past!). When I cut the code from the scene and paste it in the lua developper test window, it is doing what is asked. It seams lua code is not functionning when in scenes…[/quote]

This may happen if you have error in code somewhere or your plugin is giving “error in lua for scenes” message.
Check in notification section if you have Notifications Header enabled.
If yes, you should see blue bar (header) on top of the screen if something is wrong with your code. Unfortunately it doesn’t give you any hint where is the problem, so you need to investigate scene by scene.

Hello Kwieto I will investigate in this part. Strange thing is I didn’t change any code to produce this situation. something went corrupt.
For Rafale, a snippet of code that doesn’t function any more (but did in the past)
function resetSensor (device)
local SECURITY_SENSOR_SERVICE =“urn:micasaverde-com:serviceId:SecuritySensor1”
luup.variable_set (SECURITY_SENSOR_SERVICE, “Tripped”, 0, device)
end

resetSensor(180) – SSalleamanger
resetSensor(26) – SFrontdoor
resetSensor(62) – SGarageBack
resetSensor(82) – SHallDown
resetSensor(204) – SHallUp
resetSensor(87) – SKitchen
resetSensor(185) – SSalon
resetSensor(214) – SCac
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“RunScene”,{ SceneNum=“64” }, 0) - bipbip
return False

I’m always suspicious when I see a “return false” at the end of scene Lua.

Are you aware that returning false has two effects? (1) the Lua runs first, and if it returns false, nothing else in the scene runs–any specific device actions configured on the scene that aren’t done in the Lua will not be run; and (2) the Vera UI will not update the “last run” time/date for the scene, as it consider the scene to not have run. It still reports success when running the scene, however.

I would try changing your return to a “true” and seeing if it behaves more in line with your expectations.