Help Please - Scene LUA causing... Error in lua for scenes and events

Hoping you guys can help me understand why the below LUA (2 separate LUA in separate scenes) are causing the startup error.

thx

local vacation_mode = luup.variable_get(“urn:dcineco-com:serviceId:MSwitch1”,“Status7”,224)
local aaron_traveling = luup.variable_get(“urn:dcineco-com:serviceId:MSwitch1”,“Status7”,223)
– Do NOT Run when Vacation or Aaron_Travel virtual switch is on
if (vacation_mode==“1” or aaron_traveling==“1”) then
return false
end

function resetSensor (device)
local SECURITY_SENSOR_SERVICE =“urn:micasaverde-com:serviceId:SecuritySensor1”
luup.variable_set (SECURITY_SENSOR_SERVICE, “Tripped”, 0, device)
end

resetSensor(271) – Main Room Motion Vista 20p
resetSensor(149) – Dining Room Motion
resetSensor(552) – Entry Motion multi
resetSensor(209) – Garage Motion 2
resetSensor(164) – Garage Motion
resetSensor(567) – Living Room multi
resetSensor(155) – Media Room Motion
resetSensor(579) – Motion multi 1
resetSensor(151) – Mudroom Motion
resetSensor(150) – Office Motion Sensor
resetSensor(210) – Patio Motion Sensor
resetSensor(163) – Playroom Motion Sensor
resetSensor(571) – Deck Motion multi

Just a stab, but shouldn’t both have a “return true” at the end?

–Richard

[quote=“rlmalisz, post:2, topic:195136”]Just a stab, but shouldn’t both have a “return true” at the end?

–Richard[/quote]

Thx for the help. I’m not 100% clear when ‘return true’ is needed.
Just one at the very end of each code set - Like below?

local vacation_mode = luup.variable_get(“urn:dcineco-com:serviceId:MSwitch1”,“Status7”,224)
local aaron_traveling = luup.variable_get(“urn:dcineco-com:serviceId:MSwitch1”,“Status7”,223)
– Do NOT Run when Vacation or Aaron_Travel virtual switch is on
if (vacation_mode==“1” or aaron_traveling==“1”) then
return false
end

return true

function resetSensor (device)
local SECURITY_SENSOR_SERVICE =“urn:micasaverde-com:serviceId:SecuritySensor1”
luup.variable_set (SECURITY_SENSOR_SERVICE, “Tripped”, 0, device)
end

resetSensor(271) – Main Room Motion Vista 20p
resetSensor(149) – Dining Room Motion
resetSensor(552) – Entry Motion multi
resetSensor(209) – Garage Motion 2
resetSensor(164) – Garage Motion
resetSensor(567) – Living Room multi
resetSensor(155) – Media Room Motion
resetSensor(579) – Motion multi 1
resetSensor(151) – Mudroom Motion
resetSensor(150) – Office Motion Sensor
resetSensor(210) – Patio Motion Sensor
resetSensor(163) – Playroom Motion Sensor
resetSensor(571) – Deck Motion multi

return true

return true or NO return (i.e. just running out of code to run) will allow the scene/trigger to continue.

return false with cause the scene/trigger to be canceled.