Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- %% properties
- 55 value
- %% globals
- --]]
- doorID = 55
- doorlockID = 215
- local door = fibaro:getValue(doorID, 'value')
- local trigger = fibaro:getSourceTrigger()
- if (tonumber(fibaro:countScenes())>1) then
- fibaro:debug('Kill second scene!')
- fibaro:abort()
- end
- if (trigger['type']=='property') then
- -- TÜR-TRIGGER
- if (tonumber(trigger['deviceID'])==tonumber(doorID)) then
- -- TÜR GEÖFFNET
- if (tonumber(door)==1 and fibaro:getGlobal('danalock') == 'unsecure') then
- fibaro:debug('Haustür geöffnet. doorlock war offen.')
- while (tonumber(fibaro:getValue(doorID, 'value')) > 0) do
- fibaro:debug('Haustür noch geöffnet.')
- fibaro:sleep(1*1000)
- end
- fibaro:setGlobal('danalock', 'secure')
- fibaro:call(doorlockID, 'secure')
- fibaro:debug('doorlock wieder geschlossen.')
- elseif (tonumber(door)==1 and fibaro:getGlobal('danalock') == 'secure') then
- fibaro:debug('doorlock ist sicher.')
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement