Where does one set the Execution Mode to Last Instance (I'm on a CBUS SHAC so perhaps don't have this option)?
Would the following work on the SHAC - event script name is "'Garage Door Open Too Long Notification" - script gets killed if the sensor returns to value 0
Would the following work on the SHAC - event script name is "'Garage Door Open Too Long Notification" - script gets killed if the sensor returns to value 0
Code:
if (event.getvalue() == 255) then
log('The garage door has been opened.')
os.sleep(5*60)
log('The garage door has been left open for 5 minutes.')
end
if (event.getvalue() == 0) then
log('The garage door is closed.')
item = script.get('Garage Door Open Too Long Notification')
script.kill(item.id)
end