I coded the below Luup to stop the scene from running when my door sensor is not tripped but encounter ERROR: Error in lua for scenes and events.
Tried to debug and found code fail at conditional statement, ‘if (tripped ~= “1”) then’, I keep trying to figure out what is wrong with this line but cant understand why code fail.
Luup.log shows ‘luup_log:0: 1 <0x756ca520>’ when I debug with Luup.log (tripped) before the statement.
local SENSOR = 15 – The door/window sensor device number
local SES_SID = “urn:micasaverde-com:serviceId:SecuritySensor1”
local tripped = luup.variable_get( SES_SID, “Tripped”, SENSOR) or “0”
if (tripped ~= “1”) then
return False
End
User of Vera Edge UI7
Firmware version: 1.7.1248