17.02.2022, 12:58
Hello Everyone Please I'm trying to create a security system with scripting (Arming / Disarming after entering a specific PIN code), but I'm still a beginner, I used your script with the same steps mentioned here:
https://openrb.com/example-allow-switch-...alization/
but I faced an issue when pressing the Enter button which has the following script :
local value = dpt.decode(event.datahex, dt.bool)
if value then
-- get current pin
local pin = storage.get('pin', '')
-- verify pin number
if pin == '1234' then
grp.write('1/1/7', 1)
end
-- reset pin
storage.set('pin', '')
grp.write(event.dst, false, dt.bool)
end
I noticed that only it get the current pin then rest PIN only without verifying the PIN code.
so what should I do?
Thanks for your time.
https://openrb.com/example-allow-switch-...alization/
but I faced an issue when pressing the Enter button which has the following script :
local value = dpt.decode(event.datahex, dt.bool)
if value then
-- get current pin
local pin = storage.get('pin', '')
-- verify pin number
if pin == '1234' then
grp.write('1/1/7', 1)
end
-- reset pin
storage.set('pin', '')
grp.write(event.dst, false, dt.bool)
end
I noticed that only it get the current pin then rest PIN only without verifying the PIN code.
so what should I do?
Thanks for your time.