---
title: "Z_Wave_Vera_SecuritySensor"
canonical: "https://docs.cuesystem.com/space/CVCDD/609026241/Z_Wave_Vera_SecuritySensor"
format: markdown
---
> Macro (toc)

---

#### Note 1

VERA **SecuritySensor1** settings allow distinguishing the “Tripping” when the sensor is in an “Armed” or “NotArmed” state. The function of this driver **GetStatus()** and event** OnStatusChange()** are both returning the actual sensor value(Presence/NoPresence) independently on the status of Armed or NotArmed of this device.

# Properties

|  |  |  |  |
| --- | --- | --- | --- |
| Property name | Data type | Default value | Description |
| Device |
| ID | Byte | 0 | ID of this device - see [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/619446713](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/619446713). |
| Pooling |
| Period | Time | :1 | Time period in which the driver is pooling the actual device to check its current status to recognize its status changes to generate event. |
| Event OnStatusChange |
| Enable | Boolean | No | Yes/No enables/disables generation of event when device status change was detected |
| Debug |
| Debug print | Boolean | No | Yes/No enables/disables the debug prints report from the driver. |

# Events

## OnStatusChange

This event is generated whenever the driver recognizes the change in the device state. Note that event must be enabled by appropriate property (see above). The current status of the device is pooled in time period also set by the driver property (see above).

#### Syntax

```visualbasic
Event OnStatusChange As Process(newstate As Long)
```

#### Parameters

newstate

Long - status of SecuritySensor1 device where value 0  means No presence detected and 1 means Presence detected (see **[Note 1](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609026241/Z+Wave+Vera+SecuritySensor#Note-1)**).

#### Example

```visualbasic
Process Z_Wave_SecuritySensor1_OnStatusChange( newstate As Long) Link Z_Wave_SecuritySensor1.OnStatusChange
  DebugPrintFormat ( " Presence detection {n}",newstate)
End Process
```

# Commands

## GetMyID

This command retuns current value of this device property “ID”

#### Syntax

```visualbasic
Function GetMyId() As Byte
```

#### Return value

Byte - ID in range 3-255

#### Example

```visualbasic
Id := Z_Wave_SecuritySensor1.GetMyId()
//reads ID of this SecuritySensor1 device
```

## GetStatus

This command reads current status from Z_Wave device of type SecuritySensor1

#### Syntax

```visualbasic
Function GetStatus() As Byte
```

#### Return value

Byte - current status - value 0  means No presence detected and 1 means Presence detected (see **[Note 1](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609026241/Z+Wave+Vera+SecuritySensor#Note-1)**).

#### Example

```visualbasic
iPresence := Z_Wave_SecuritySensor1.GetStatus()
//reads status of this SecuritySensor1 device
```