Sometimes there is a need to authorize an operation with a password. In the alarm systems, we have a keypad that allows us to do this. In the Grenton System, authorization can be performed using the Smart Panel.

Below are instructions on how to realize this.


To complete this example, there are needed:

  • CLU Z-Wave 
  • Grenton Smart Panel
  • Gate Alarm (optional)


  • Preparation of user features responsible for counting the number of button presses


  • Preparation of an alarm_screen  script responsible for displaying the ALARM page

The script is created to check the value of a feature, e.g. alarm system status (Gate_Alarm->alarm_state) and then set the appropriate page.


CLU->x250005193_PANEL_01->ClearScreen()
CLU->x250005193_PANEL_01->PrintText(45,10,"ALARM",1.5)
CLU->x250005193_PANEL_01->DrawLine(0,25,127,25,1)
if(Gate_Alarm->alarm_state==1) then
CLU->x250005193_PANEL_01->DrawIcon(60,35,"locked")
CLU->x250005193_PANEL_01->PrintText(15,40,"Disarm",1.5)
CLU->x250005193_PANEL_01->DisplayContent()
CLU->x250005193_PANEL_BUTTON_01->RedLedSwitchOn()
CLU->x250005193_PANEL_BUTTON_02->RedLedSwitchOn()
CLU->x250005193_PANEL_BUTTON_03->RedLedSwitchOn()
CLU->x250005193_PANEL_BUTTON_04->RedLedSwitchOn()
else
CLU->x250005193_PANEL_01->DrawIcon(60,35,"unlocked")
CLU->x250005193_PANEL_01->PrintText(15,40,"Arm",1.5)
CLU->x250005193_PANEL_01->DisplayContent()
CLU->x250005193_PANEL_BUTTON_01->LedSwitchOn()
CLU->x250005193_PANEL_BUTTON_02->LedSwitchOn()
CLU->x250005193_PANEL_BUTTON_03->LedSwitchOn()
CLU->x250005193_PANEL_BUTTON_04->LedSwitchOn()
end


  • Smart Panel configuration

Set PANEL_PAGE_01 object as following:



In PANEL_BUTTON_01, PANEL_BUTTON_02, PANEL_BUTTON_03 i PANEL_BUTTON_04 objects enter commands responsible for the increment of button_1, button_2, button_3, button_4 user features.



  • Activation, deactivation of the alarm and PIN verifying

To entering the PIN by user, it is necessary to specify the time in which the password should be entered. For this purpose, is needed to prepare Timer virtual object (PIN_timeout).



Each start of the Timer, resets the values of the user features.


In order to inform the user about the possibility of entering the password or executed activation of alarm, prepare a script called PIN_entering:

if(Gate_Alarm->alarm_state==1) then
CLU->x250005193_PANEL_01->ClearScreen()
CLU->x250005193_PANEL_01->PrintText(20,25,"Enter the PIN",1.500)
CLU->x250005193_PANEL_BUTTON_01->ShowError()
CLU->x250005193_PANEL_BUTTON_02->ShowError()
CLU->x250005193_PANEL_BUTTON_03->ShowError()
CLU->x250005193_PANEL_BUTTON_04->ShowError()
CLU->x250005193_PANEL_01->DisplayContent()
CLU->PIN_timeout->Start()
CLU->x250005193_PANEL_01->SwitchOnDisplay()
else
Gate_Alarm->alarm_state=1
CLU->alarm_screen()
end

A PIN_denial script responsible for informing the user of an incorrect password:

CLU->x250005193_PANEL_01->ClearScreen()
CLU->x250005193_PANEL_01->PrintText(25,25,"Incorrect PIN",1.500)
CLU->x250005193_PANEL_01->SetBeep(560,230,16,0)
SYSTEM.Wait(200)
CLU->x250005193_PANEL_01->SetBeep(260,130,16,0)
CLU->x250005193_PANEL_01->DisplayContent()
CLU->x250005193_PANEL_01->SwitchOnDisplay()
CLU->x250005193_PANEL_BUTTON_01->ShowError()
CLU->x250005193_PANEL_BUTTON_02->ShowError()
CLU->x250005193_PANEL_BUTTON_03->ShowError()
CLU->x250005193_PANEL_BUTTON_04->ShowError()
SYSTEM.Wait(2000)
CLU->PIN_entering()

A PIN_acceptance script responsible for informing the user of a correct password:

CLU->x250005193_PANEL_01->SwitchOnDisplay()
CLU->x250005193_PANEL_01->ClearScreen()
CLU->x250005193_PANEL_01->PrintText(20, 15, "ALARM ", 1.500)
CLU->x250005193_PANEL_01->PrintText(20, 30, "INACTIVE", 1.500)
CLU->x250005193_PANEL_01->DisplayContent()
CLU->x250005193_PANEL_BUTTON_01->ShowOK()
CLU->x250005193_PANEL_BUTTON_02->ShowOK()
CLU->x250005193_PANEL_BUTTON_03->ShowOK()
CLU->x250005193_PANEL_BUTTON_04->ShowOK()
CLU->x250005193_PANEL_01->SetBeep(560,230,16,0)
SYSTEM.Wait(1000)
CLU->alarm_screen()


After the time for entering the password has elapsed, following script (PIN_verification) will be run:

if(not (CLU->button_1==2)) then
CLU->PIN_denial()
else
if(not (CLU->button_2==3)) then
CLU->PIN_denial()
else
if(not (CLU->button_3==1)) then
CLU->PIN_denial()
else
if(not (CLU->button_4==1)) then
CLU->PIN_denial()
else
CLU->PIN_acceptance()
Gate_Alarm->alarm_state=0
CLU->alarm_screen()
end
end
end
end

The above mentioned scripts should be assigned to the events as follows:


In PIN_timeout virtual object:


In PANEL_BUTTON_03 object:


Additionally, in embedded features of PANEL_BUTTON_03 object, increment the value of HoldInterval feature:



The configuration should be sent to the CLU unit.

On hold press of PANEL_BUTTON_03  the alarm will be activated. When the alarm is active, a long press of the PANEL_BUTTON_03 allows you to enter the password.