Skip to content

alarm

The alarm block is a software equivalent of a physical alarm system. Its purpose is to monitor specific conditions and generate an alarm signal when those conditions are met. After adding the alarm block to the project, the mobile application will create a related virtual device that allows the user to arm/disarm the alarm and monitor its status.

Configuration parameters

Parameter name Value
Alarm arming time (arming_time) Numeric field specifying the time until the alarm is armed, in seconds. The minimum value is 10 seconds and the maximum value is 300 seconds (that is, 5 minutes).
Alarm disarming time (unarming_time) Numeric field specifying the time until the alarm is disarmed, in seconds. The minimum value is 10 seconds and the maximum value is 300 seconds (that is, 5 minutes).
Keypad lock time after failed attempts to enter the alarm code (lockoutDuration) Numeric field specifying how long the keypad remains locked after failed attempts to enter the code while arming/disarming the alarm. Entering 0 means the keypad is locked permanently. Entering a value from 10 to 3600 seconds means that after this time it will be possible to enter the code once in order to arm/disarm the alarm. Entering an incorrect code will lock the keypad again for the time defined by this parameter.
Number of incorrect code entry attempts after which the keypad is locked (lockoutThreshold) Numeric field. Allowed values are 1-20 attempts. After the allowed number of attempts is exceeded, the keypad will be locked for the time specified in the block configuration.
Immediate confirmation of alarm arming (immediateArmConfirmation) If this field is checked, output no. 3 will report the armed state immediately. If this field is not checked, output no. 3 will report the armed state only after the alarm arming time has elapsed.
Alarm user code 1 (userCode1) Required value. Text field accepting 4 to 8 digits that make up user code no. 1.
Alarm user code 2 (userCode2) Optional value. Text field accepting 4 to 8 digits that make up user code no. 2.
Alarm user code 3 (userCode3) Optional value. Text field accepting 4 to 8 digits that make up user code no. 3.
Alarm user code 4 (userCode4) Optional value. Text field accepting 4 to 8 digits that make up user code no. 4.
Alarm user code 5 (userCode5) Optional value. Text field accepting 4 to 8 digits that make up user code no. 5.

Input handling

The alarm block reads values from input lines marked with the "tag" block. The table below describes the meaning of individual inputs:

Input number and name Description
tag1: Force arm the alarm. Sending the value true to the input on the tag1 line arms the alarm without requiring a user code. This always works regardless of the lock state. If immediate sensors detect motion while the alarm is being armed, the alarm will report a break-in immediately.
tag2: Force disarm the alarm. Sending the value true to the input on the tag2 line disarms the alarm without requiring a user code. This always works regardless of the keypad lock state.
tag3: Arm the alarm using a code. Sending a user code as text to the input on the tag3 line arms the alarm if the code is valid and the alarm is not locked. If the code is invalid, the failed-attempt counter is increased by 1, which may lock the keypad. If the keypad is locked, arming the alarm using this method is not possible. Arming the alarm using this method will also fail if an immediate sensor is reporting an event.
tag4: Disarm the alarm using a code. Sending a user code to the input on the tag4 line disarms the alarm if the code is valid and the alarm is not locked. If the code is invalid, the failed-attempt counter is increased by 1, which may lock the keypad. If the keypad is locked, disarming the alarm using this method is not possible.
tag5: Immediate sensors. Sending the value true to the input on the tag5 line is interpreted as motion detection and triggers the alarm immediately if the alarm is armed. Immediate sensors may also cause keypad lockout, preventing the user from arming the alarm with a code as long as they detect motion.
tag6: Delayed sensors. Sending the value true to the input on the tag6 line is interpreted as motion detection and triggers the alarm after the configured disarming time if the alarm is armed. During this time, the user has time to enter the code that allows the alarm to be disarmed.
tag7: Lock input. Sending the value true to the tag7 input enables keypad lockout, so the alarm cannot be armed or disarmed with a code. Arming/disarming is still possible using tag1 and tag2. Sending false removes this lock, but it does not remove other causes of lockout (for example multiple incorrect codes or an active immediate sensor).
tag8: Unlock input. Sending the value true to the input on the tag8 line unlocks the alarm if it is locked because the threshold of incorrect user code attempts has been exceeded. This input does not affect the lock flag set by the tag7 line.
tag9: Change user code. The user code is changed by sending a text message to the input on the tag9 line in the following format:

n:code

where n is the user code number (1 to 5), and code is the new user code (a string of digits from 4 to 8 characters long). For example, to set user code 3 to 1234, send the message 3:1234. If code is empty, the user code will be removed (if n is from 2 to 5). Changing the user code always works regardless of the lock state. Changed user codes are not saved to the block configuration and will be lost after the project is restarted.

Block outputs

Output number and name Output description
1. Outdoor siren. Returns the value true when a break-in is detected; otherwise returns false.
2. Indoor siren. Returns true or false to provide audible alarm signaling in the following situations:

1. While counting down to full alarm arming, the output alternates between true and false.
2. During the last 5 seconds of the countdown to full alarm arming, the output returns true.
3. Just like in points 1 and 2, this output behaves the same during the countdown when the alarm is armed and has detected an event from delayed sensors.
4. When a break-in is detected, the output returns true (just like the outdoor siren).
5. In all other cases, the output returns false.
3. Armed state. Returns true when the alarm is armed; otherwise returns false. If the immediate confirmation of alarm arming option is enabled in the block configuration, the output will return true already during the countdown to full arming.
4. Number of the user who armed the alarm. Returns the user number (1-5) of the user who armed the alarm. If the alarm is not currently armed or was armed without using a code (for example using tag1), then the returned value is null.
5. Number of the user who disarmed the alarm. Returns the user number (1-5) of the user who disarmed the alarm. If the alarm is not currently disarmed or was disarmed without using a code (for example using tag2), then the returned value is null.
6. Lockout state after entering an incorrect code. If the maximum number of incorrect attempts to enter the alarm code has been exceeded, this output returns true. Otherwise it returns false.
7. Keypad lockout state set from the configurator. Returns true if the keypad has been locked by the project configuration using the input marked with tag7. Otherwise it returns false.