Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- %% properties
- 96 userCodes
- %% globals
- --]]
- -- HIER DIE ARRAYS ANPASSEN (neue IDs können einfach hinzugefügt werden)
- local tagReader = 96 -- ID des RFID-Leser (bitte auch in dem Header ändern)
- local doorID = {16, 18, 20, 55} -- IDs der Sensoren
- local phoneID = {68, 113} -- IDs der Handys, an die eine Push geschickt werden soll
- local countID = 1000 -- Anzahl eurer devices (Muss nicht zwangsläufig geändert werden)
- -- OPTIONEN
- -- Prüfung einer globalen Variable für Chip 3/4, ob diese gültig ist.
- -- Bei nicht Nutzung dieser Funktion müsst Ihr nichts weiter einrichten.
- -- Solltet Ihr diese nutzen wollen, dann müsst Ihr für jeden Chip eine Variable anlegen (z.B rfid_active1)
- local rfid_active3 = fibaro:getGlobalValue('rfid_active3') -- Variable zum Prüfen ob RFID-Chip1 gültig ist oder nicht (active = gültig/inactive = ungültig)
- local rfid_active4 = fibaro:getGlobalValue('rfid_active4') -- Variable zum Prüfen ob RFID-Chip2 gültig ist oder nicht (active = gültig/inactive = ungültig)
- -- Hier könnt Ihr mit der 1 setzen, dass die RFID-Tags nur zum entschärfen genutzt werden sollen
- local rfid_use1 = 1 -- Wenn Ihr mit dem RFID-Tag1 nur entschärfen wollt, bitte auf 1 setzen
- local rfid_use2 = 1 -- Wenn Ihr mit dem RFID-Tag2 nur entschärfen wollt, bitte auf 1 setzen
- local rfid_use3 = 0 -- Wenn Ihr mit dem RFID-Tag3 nur entschärfen wollt, bitte auf 1 setzen
- local rfid_use4 = 0 -- Wenn Ihr mit dem RFID-Tag4 nur entschärfen wollt, bitte auf 1 setzen
- -- Prüfung, ob Ihr eigene Aktionen ausführen möchtet (Siehe FUNKTIONEN FÜR AKTIONEN)
- local own_action = 1 -- Bitte auf 1 setzen, wenn Ihr eigene Aktionen ausführen wollt.
- -- 10-stellige Byte-Array's (Bytes, weil RFID-Tags auch Zeichen ausserhalb des lesbaren Bereichs liefern)
- local rfid1 = {143, 80, 84, 84, 42, 0, 1, 4, 0, 0} -- <--ANPASSEN: Byte-Array eines RFID-Tags
- local rfid2 = {143, 174, 97, 84, 42, 0, 1, 4, 0, 0} -- <--ANPASSEN: Byte-Array eines RFID-Tags
- local rfid3 = {143, 80, 84, 84, 42, 0, 1, 4, 0, 0} -- <--ANPASSEN: Byte-Array eines RFID-Tags
- local rfid4 = {143, 174, 97, 84, 42, 0, 1, 4, 0, 0} -- <--ANPASSEN: Byte-Array eines RFID-Tags
- local code = {49, 50, 51, 52, 0, 0, 0, 0, 0, 0} -- <--ANPASSEN: Byte-Array für Zahlencode (1234 als Unicode)
- -- WIDGET-Support
- -- Solltet Ihr die Widget-Funktion der App nutzen wollen, dann könnt Ihr die Option hier aktivieren
- -- ACHTUNG: Solltet Ihr die Szene manuell ausführen, dann wird der Alarm gesetzt
- local widget = true -- false = Widget wird nicht genutzt; true = Widget wird genutzt
- -- DOORLOCK-Integration
- -- Hier kann ein Doorlock hinzugefügt werden, was die Tür nach schärfen/entschärfen automatisch auf/zu schließt.
- -- Die Option kann über die Variable doorlock auf true/false (Standart ist false) gesetzt werden
- -- ACHTUNG: Die Funktion zum Öffnen mit RFID/Code funktioniert nur, wenn PresentState auf 'home' steht; NUTZUNG AUF EIGENE GEFAHR
- local doorlock = false -- false = Kein Doorlock im Einsatz; true = Doorlock soll über das Skript geschaltet werden
- local doorlockID = 211 -- ID des Doorlocks
- -- Wie soll der doorlock geöffnet werden (Falls jemand zu Hause ist und Ihr kommt zusätzlich nach Hause und wollt keinen Schlüssel nutzen)
- -- rfid = Über den RFID-Chip (dann kann dieser aber nicht mehr zum schärfen der Alarmanlage verwendet werden
- -- pin = Dann könnt Ihr mit einem zusätzlichen Code (open_code) die Tür öffnen
- local doorlock_open = 'pin'
- local open_code = {50, 50, 50, 50, 0, 0, 0, 0, 0, 0} -- <--ANPASSEN: Byte-Array für Zahlencode (1234 als Unicode)
- local rfid_doorlock1 = 1 -- Wenn Ihr mit dem RFID-Tag1 nur entschärfen wollt, bitte auf 1 setzen
- local rfid_doorlock2 = 1 -- Wenn Ihr mit dem RFID-Tag2 nur entschärfen wollt, bitte auf 1 setzen
- local rfid_doorlock3 = 0 -- Wenn Ihr mit dem RFID-Tag3 nur entschärfen wollt, bitte auf 1 setzen
- local rfid_doorlock4 = 0 -- Wenn Ihr mit dem RFID-Tag4 nur entschärfen wollt, bitte auf 1 setzen
- local readerCode = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} -- leeres Byte-Array, in dem nachher der gelesene Code steht (RFID-Tag oder Zahlencode)
- -- FUNKTIONEN FÜR AKTIONEN (z.B. TTS, LICHT AUS)
- ------------------------------------------------
- -- Aktionen nach dem Schärfen mit Delay, bvor die Sensoren geschäft sind
- function actionsbeforeArmed()
- fibaro:debug('Führe eigene Funktionen vor Schärfen aus')
- end
- -- Aktionen nach dem endgültigen Schärfen
- function actionsafterArmed()
- fibaro:debug('Führe eigene Funktionen nach dem Schärfen aus')
- end
- -- Aktionen nach dem Entschärfen
- function actionsafterDisarmed()
- fibaro:debug('Führe eigene Funktionen nach dem Entschärfen aus')
- end
- -------------------------------------------------
- -- OPTIONEN ENDE -- AB HIER NICHTS MEHR ÄNDERN --
- fibaro:debug('RFID-Scene -Version 1.3- gestartet');
- Debug = function ( color, message )
- fibaro:debug(string.format('<%s style="color:%s;">%s</%s>', "span", color, message, "span"))
- end
- if (rfid_active3 == nil) then
- fibaro:debug('Keine Variable für RFID3 gesetzt; Funktion wird nicht genutzt')
- local rfid_active3 = 'active'
- end
- if (rfid_active4 == nil) then
- fibaro:debug('Keine Variable für RFID4 gesetzt; Funktion wird nicht genutzt')
- local rfid_active4 = 'active'
- end
- -- FUNKTIONEN (bitte nicht ändern)
- function compareCodes(array1, array2)
- if (#array1 ~= 10 or #array2 ~= 10) then
- fibaro:debug('Grösse der Arrays ungültig...')
- return false
- end
- for i = 1, #array1 do
- if (array1[i] ~= array2[i]) then
- return false
- end
- end
- return true
- end
- function armedcheckSensorID(array)
- for j=1, countID do
- if doorID[j] ~= nil then
- if (tonumber(fibaro:getValue(doorID[j], 'armed')) == 0) then
- return false
- end
- end
- end
- return true
- end
- local startSource = fibaro:getSourceTrigger()
- if (startSource['deviceID'] == tagReader) then
- local delay = 0
- -- RFID auslesen
- local userCodes = fibaro:get(tagReader, 'userCodes')
- jsontbl = json.decode(userCodes)
- -- nach dem Code mit der ID 0 suchen
- for i = 1, #jsontbl do
- if (jsontbl[i].id == 0) then
- -- die 10 Zeichen lesen und in das leere Byte-Array abfüllen
- for b = 1, string.len(jsontbl[i].code) do
- readerCode[b] = string.byte(jsontbl[i].code,b)
- end
- if (compareCodes(rfid1, readerCode) or compareCodes(rfid2, readerCode) or (compareCodes(rfid3, readerCode) and rfid_active3 == 'active') or (compareCodes(rfid4, readerCode) and rfid_active4 == 'active')) then
- if (fibaro:getGlobal('PresentState') == 'Home') then
- -- Prüfung, ob RFID zum Schärfen genutzt werden darf/Zum Öffnen der Tür
- if (compareCodes(rfid1, readerCode) and rfid_use1 == 1) then
- fibaro:debug('Scene abgebrochen. Mit diesem RFID-Tag 1 dürfen die Sensoren nicht geschärft werden.')
- if (doorlock and rfid_doorlock1 == 1) then
- fibaro:debug('Doorlock vorhanden, Tür wird geöffnet.')
- fibaro:call(doorlockID, 'unsecure')
- end
- fibaro:abort()
- end
- ---------------ENDE PRÜFUNG--------------------------
- -- Prüfung, ob RFID zum Schärfen genutzt werden darf/Zum Öffnen der Tür
- if (compareCodes(rfid2, readerCode) and rfid_use2 == 1) then
- fibaro:debug('Scene abgebrochen. Mit diesem RFID-Tag 2 dürfen die Sensoren nicht geschärft werden.')
- if (doorlock and rfid_doorlock2 == 1) then
- fibaro:debug('Doorlock vorhanden, Tür wird geöffnet.')
- fibaro:call(doorlockID, 'unsecure')
- end
- fibaro:abort()
- end
- ---------------ENDE PRÜFUNG--------------------------
- -- Prüfung, ob RFID zum Schärfen genutzt werden darf/Zum Öffnen der Tür
- if (compareCodes(rfid3, readerCode) and rfid_use3 == 1) then
- fibaro:debug('Scene abgebrochen. Mit diesem RFID-Tag 3 dürfen die Sensoren nicht geschärft werden.')
- if (doorlock and rfid_doorlock3 == 1) then
- fibaro:debug('Doorlock vorhanden, Tür wird geöffnet.')
- fibaro:call(doorlockID, 'unsecure')
- end
- fibaro:abort()
- end
- ---------------ENDE PRÜFUNG--------------------------
- -- Prüfung, ob RFID zum Schärfen genutzt werden darf/Zum Öffnen der Tür
- if (compareCodes(rfid4, readerCode) and rfid_use4 == 1) then
- fibaro:debug('Scene abgebrochen. Mit diesem RFID-Tag 4 dürfen die Sensoren nicht geschärft werden.')
- if (doorlock and rfid_doorlock4 == 1) then
- fibaro:debug('Doorlock vorhanden, Tür wird geöffnet.')
- fibaro:call(doorlockID, 'unsecure')
- end
- fibaro:abort()
- end
- fibaro:debug('RFID-Tag akzeptiert - Haus wurde verlassen')
- fibaro:setGlobal('PresentState', 'Away')
- if (own_action == 1) then
- actionsbeforeArmed()
- end
- local delay = tonumber(fibaro:getValue(doorID[1], "armDelay"))
- if (delay ~= 0) then
- fibaro:debug('Arm-Delay erkannt. Arm-Delay: ' ..delay)
- end
- for j=1, countID do
- if doorID[j] ~= nil then
- if (tonumber(fibaro:getValue(doorID[j], 'value')) == 0) then
- fibaro:call(doorID[j], 'setArmed', '1')
- else
- local sensorname = fibaro:getName(doorID[j])
- local sensorroom = fibaro:getRoomNameByDeviceID(doorID[j])
- fibaro:debug('ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' nicht sicher. Sende Push.')
- for k=1, countID do
- if phoneID[k] ~= nil then
- fibaro:call(phoneID[k], 'sendPush', 'ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' nicht sicher.')
- end
- end
- end
- end
- end
- fibaro:debug('Warte ' .. delay .. ' Sekunden')
- delay = delay + 1
- fibaro:sleep(delay*1000)
- if (fibaro:getGlobal('PresentState') == 'Away') then
- if (armedcheckSensorID(doorID)) then
- if (own_action == 1) then
- actionsafterArmed()
- end
- for l=1, countID do
- if phoneID[l] ~= nil then
- fibaro:call(phoneID[l], 'sendPush', 'RFID: Alarmanlage SCHARF')
- end
- end
- fibaro:debug('Alle Sensoren geschärft. Sende Push')
- if (doorlock) then
- fibaro:call(doorlockID, 'secure')
- fibaro:debug('doorlock vorhanden, Tür wurde geschlossen!')
- end
- else
- fibaro:debug('Es konnten nicht alle Sensoren scharf geschaltet werden')
- end
- else
- fibaro:debug('Alarm wurde während der Delay-Time deaktiviert')
- end
- elseif (fibaro:getGlobal('PresentState') == 'Away') then
- fibaro:debug('RFID-Tag akzeptiert - Welcome@Home')
- fibaro:setGlobal('PresentState', 'Home')
- for m=1, countID do
- if doorID[m] ~= nil then
- fibaro:call(doorID[m], 'setArmed', '0')
- end
- end
- if (armedcheckSensorID(doorID)) then
- fibaro:debug('Es konnten nicht alle Sensoren entschäft werden');
- for t=1, countID do
- if doorID[t] ~= nil then
- if (tonumber(fibaro:getValue(doorID[t], 'armed')) == 1) then
- local sensorname = fibaro:getName(doorID[t])
- local sensorroom = fibaro:getRoomNameByDeviceID(doorID[t])
- fibaro:debug('ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' konnte nicht entschärft werden. Sende Push.')
- for o=1, countID do
- if phoneID[o] ~= nil then
- fibaro:call(phoneID[o], 'sendPush', 'ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' nicht entschärft.')
- end
- end
- end
- end
- end
- else
- fibaro:debug('Alle Sensoren entschärft. Sende Push')
- if (doorlock) then
- fibaro:call(doorlockID, 'unsecure')
- fibaro:debug('doorlock vorhanden, Tür wurde geöffnet')
- end
- for l=1, countID do
- if phoneID[l] ~= nil then
- fibaro:call(phoneID[l], 'sendPush', 'RFID: Alarmanlage entschärft')
- end
- end
- if (own_action == 1) then
- actionsafterDisarmed()
- end
- end
- else
- fibaro:debug('RFID-Tag akzeptiert - Variablen nicht korrekt gesetzt.')
- end
- elseif (compareCodes(code, readerCode)) then
- fibaro:debug('PIN-Code akzeptiert.')
- fibaro:setGlobal('PresentState', 'Away')
- for z=1, countID do
- if doorID[z] ~= nil then
- if (tonumber(fibaro:getValue(doorID[z], 'value')) == 0) then
- fibaro:call(doorID[z], 'setArmed', '1')
- else
- local sensorname = fibaro:getName(doorID[z])
- local sensorroom = fibaro:getRoomNameByDeviceID(doorID[z])
- fibaro:debug('ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' nicht sicher. Sende Push.')
- for y=1, countID do
- if phoneID[y] ~= nil then
- fibaro:call(phoneID[y], 'sendPush', 'ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' nicht sicher.')
- end
- end
- end
- end
- end
- if (own_action == 1) then
- actionsbeforeArmed()
- end
- local delay = tonumber(fibaro:getValue(doorID[1], "armDelay"))
- if (delay ~= 0) then
- fibaro:debug('Arm-Delay erkannt. Arm-Delay: ' ..delay)
- end
- fibaro:debug('Warte ' .. delay .. ' Sekunden')
- delay = delay + 1
- fibaro:sleep(delay*1000)
- if (fibaro:getGlobal('PresentState') == 'Away') then
- if (armedcheckSensorID(doorID)) then
- if (own_action == 1) then
- actionsafterArmed()
- end
- for l=1, countID do
- if phoneID[l] ~= nil then
- fibaro:call(phoneID[l], 'sendPush', 'PIN-CODE: Alarmanlage SCHARF')
- end
- end
- fibaro:debug('Alle Sensoren geschärft. Sende Push')
- if (doorlock) then
- fibaro:call(doorlockID, 'secure')
- fibaro:debug('doorlock vorhanden, Tür wurde geschlossen')
- end
- else
- fibaro:debug('Es konnten nicht alle Sensoren scharf geschaltet werden');
- end
- else
- fibaro:debug('Alarm wurde während der Delay-Time deaktiviert');
- end
- elseif (compareCodes(open_code, readerCode) and fibaro:getGlobal('PresentState') == 'Home' and doorlock_open == 'pin') then
- fibaro:debug('PIN-Code zum Öffnen der Tür akzeptiert.')
- if (doorlock) then
- fibaro:call(doorlockID, 'unsecure')
- fibaro:debug('doorlock vorhanden, es war schon jemand zu Hause, Tür wird geöffnet')
- for r=1, countID do
- if phoneID[r] ~= nil then
- fibaro:call(phoneID[r], 'sendPush', 'Tür würde mit PIN geöffnet')
- end
- end
- end
- else
- fibaro:debug('RFID-Tag/PIN-Code wurde abgelehnt. Manipulation oder Karte inaktiv? Push versendet')
- for r=1, countID do
- if phoneID[r] ~= nil then
- fibaro:call(phoneID[r], 'sendPush', 'ACHTUNG: Code falsch eingegeben/RFID inaktiv')
- end
- end
- end
- end
- end
- else
- if (widget) then
- if (fibaro:getGlobal('PresentState') == 'Home') then
- fibaro:debug('Szene durch Widget gestartet - Haus wurde verlassen')
- fibaro:setGlobal('PresentState', 'Away')
- if (own_action == 1) then
- actionsbeforeArmed()
- end
- local delay = tonumber(fibaro:getValue(doorID[1], "armDelay"))
- if (delay ~= 0) then
- fibaro:debug('Arm-Delay erkannt. Arm-Delay: ' ..delay)
- end
- for j=1, countID do
- if doorID[j] ~= nil then
- if (tonumber(fibaro:getValue(doorID[j], 'value')) == 0) then
- fibaro:call(doorID[j], 'setArmed', '1')
- else
- local sensorname = fibaro:getName(doorID[j])
- local sensorroom = fibaro:getRoomNameByDeviceID(doorID[j])
- fibaro:debug('ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' nicht sicher. Sende Push.')
- for k=1, countID do
- if phoneID[k] ~= nil then
- fibaro:call(phoneID[k], 'sendPush', 'ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' nicht sicher.')
- end
- end
- end
- end
- end
- fibaro:debug('Warte ' .. delay .. ' Sekunden')
- delay = delay + 1
- fibaro:sleep(delay*1000)
- if (fibaro:getGlobal('PresentState') == 'Away') then
- if (armedcheckSensorID(doorID)) then
- if (own_action == 1) then
- actionsafterArmed()
- end
- for l=1, countID do
- if phoneID[l] ~= nil then
- fibaro:call(phoneID[l], 'sendPush', 'Widget: Alarmanlage SCHARF')
- end
- end
- fibaro:debug('Alle Sensoren geschärft. Sende Push')
- if (doorlock) then
- fibaro:call(doorlockID, 'secure')
- fibaro:debug('doorlock vorhanden, Tür wurde geschlossen!')
- end
- else
- fibaro:debug('Es konnten nicht alle Sensoren scharf geschaltet werden')
- end
- else
- fibaro:debug('Alarm wurde während der Delay-Time deaktiviert')
- end
- elseif (fibaro:getGlobal('PresentState') == 'Away') then
- fibaro:debug('Szene durch Widget gestartet - Welcome@Home')
- fibaro:setGlobal('PresentState', 'Home')
- for m=1, countID do
- if doorID[m] ~= nil then
- fibaro:call(doorID[m], 'setArmed', '0')
- end
- end
- if (armedcheckSensorID(doorID)) then
- fibaro:debug('Es konnten nicht alle Sensoren entschäft werden');
- for t=1, countID do
- if doorID[t] ~= nil then
- if (tonumber(fibaro:getValue(doorID[t], 'armed')) == 1) then
- local sensorname = fibaro:getName(doorID[t])
- local sensorroom = fibaro:getRoomNameByDeviceID(doorID[t])
- fibaro:debug('ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' konnte nicht entschärft werden. Sende Push.')
- for o=1, countID do
- if phoneID[o] ~= nil then
- fibaro:call(phoneID[o], 'sendPush', 'ACHTUNG: ' .. sensorname .. ' im Raum: ' .. sensorroom .. ' nicht entschärft.')
- end
- end
- end
- end
- end
- else
- fibaro:debug('Alle Sensoren entschärft. Sende Push')
- if (doorlock) then
- fibaro:call(doorlockID, 'unsecure')
- fibaro:debug('doorlock vorhanden, Tür wurde geöffnet')
- end
- for l=1, countID do
- if phoneID[l] ~= nil then
- fibaro:call(phoneID[l], 'sendPush', 'Widget: Alarmanlage entschärft')
- end
- end
- if (own_action == 1) then
- actionsafterDisarmed()
- end
- end
- end
- else
- fibaro:debug('Szene manuell gestartet. Auslesen der Informationen')
- local userCodes = fibaro:get(tagReader, 'userCodes')
- jsontbl = json.decode(userCodes)
- -- nach dem Code mit der ID 0 suchen
- for i = 1, #jsontbl do
- if (jsontbl[i].id == 0) then
- -- die 10 Zeichen lesen und in das leere Byte-Array abfüllen
- for b = 1, string.len(jsontbl[i].code) do
- readerCode[b] = string.byte(jsontbl[i].code,b)
- end
- fibaro:debug('RFID-INFO: {' .. readerCode[1] .. ', ' .. readerCode[2] .. ', ' .. readerCode[3] .. ', ' .. readerCode[4] .. ', ' .. readerCode[5] .. ', ' .. readerCode[6] .. ', ' .. readerCode[7] .. ', ' .. readerCode[8] .. ', ' .. readerCode[9] .. ', ' .. readerCode[10] .. '}')
- end
- end
- fibaro:debug('Diese Info in die lokalen Arrays rfid1,rfid2,code eintragen')
- if (fibaro:getGlobal('PresentState') ~= nil) then
- local PresentState = fibaro:getGlobal('PresentState')
- Debug( 'green', 'Die Variable PresentState wurde gefunden. Status: ' ..PresentState)
- else
- Debug( 'red', 'Die Variable PresentState wurde nicht gefunden. Bitte einrichten! rfid_alarm wird nicht mehr unterstützt.')
- end
- local delay = tonumber(fibaro:getValue(doorID[1], 'armDelay'))
- if (delay ~= 0) then
- fibaro:debug('Arm-Delay erkannt. Arm-Delay: ' ..delay)
- else
- fibaro:debug('Kein Arm-Delay erkannt.')
- end
- if (doorlock) then
- Debug( 'green', 'doorlock mit der ID ' ..doorlockID.. ' erkannt');
- else
- fibaro:debug('Kein doorlock erkannt')
- end
- if (doorlock) then
- if (doorlock_open == 'rfid') then
- Debug( 'white', 'doorlock soll mit den RFID-Tags geöffnet werden können. Prüfe Abhängigkeiten.')
- local error_rfid = 0
- if (rfid_use1 == 0 and rfid_doorlock1 == 1) then
- Debug( 'red', 'RFID-Tag 1 soll zum Schärfen und zum Öffnen genutzt werden. Dies ist nicht möglich. Bitte ändern!')
- error_rfid = 1
- end
- if (rfid_use2 == 0 and rfid_doorlock2 == 1) then
- Debug( 'red', 'RFID-Tag 2 soll zum Schärfen und zum Öffnen genutzt werden. Dies ist nicht möglich. Bitte ändern!')
- error_rfid = 1
- end
- if (rfid_use3 == 0 and rfid_doorlock3 == 1) then
- Debug( 'red', 'RFID-Tag 3 soll zum Schärfen und zum Öffnen genutzt werden. Dies ist nicht möglich. Bitte ändern!')
- error_rfid = 1
- end
- if (rfid_use4 == 0 and rfid_doorlock4 == 1) then
- Debug( 'red', 'RFID-Tag 4 soll zum Schärfen und zum Öffnen genutzt werden. Dies ist nicht möglich. Bitte ändern!')
- error_rfid = 1
- end
- if (error_rfid == 0) then
- Debug( 'green', 'Abhängigkeiten bei den RFID-Tags in Ordnung')
- end
- elseif (doorlock_open == 'pin') then
- Debug( 'white', 'doorlock soll mit einem PIN geöffnet werden. Prüfe PINs.')
- if (compareCodes(code, open_code)) then
- Debug( 'red', 'Die PINs zum öffnen und schärfen sind gleich, bitte einen ändern.')
- else
- Debug( 'green', 'Die PINs sind in Ordnung')
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement