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

<details>
<summary>Detail contents</summary>

> Macro (toc)
</details>

The Z-Wave technology is a wireless technology used primarily in building automation systems - but is also applied to other applications in industry, transportation, logistics, and smart homes. Products based on Z-Wave technology combine low-power electronics and enable wireless communications between sensors, switches, controllers, and gateways.

The Vera products are on many markets the most popular controllers for Z-Wave. It is frequently installed as the first attempt to reach a higher level of integration and especially when demanded to make all available sensors to work as the Security system. The Vera controllers can be used as the gateway to control connected Z-Wave devices from the Cue system.

The Z-Wave devices which are to be controlled with help of this driver must be properly included in the Vera controller Z-Wave network. Follow the procedure for adding all Z-Wave devices into Vera project – how to do it see Vera documentation available on the web (for example [http://www.vesternet.com/resources/application-notes/apnt-101](http://www.vesternet.com/resources/application-notes/apnt-101) , …) As the next step create all required scenes ([http://www.vesternet.com/resources/application-notes/apnt-103](http://www.vesternet.com/resources/application-notes/apnt-103)) and link them to appropriate scene controllers – if Z-Wave scene controllers or Vera scene control is to be used in the project then refer to SceneController1 device driver and its description!)

All the devices added into the Vera project are identified by its own unique device ID number (in range 3-255) The “ID” value is assigned during the device adding into Vera project. This “ID” information is vital for usage in the commands available in this driver for each device and its control see [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/619446713](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/619446713).

The Vera project recognizes several types of controlled devices. The device types are based on their UPnP definitions (where it is available).

The most important types are: 

- Dimming - [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609419481](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609419481)
- EnergyMettering - [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/607715737](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/607715737)
- SceneController- [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609255630](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609255630)
- SecuritySensor - [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609026241](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609026241)
- SwitchPower - [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/607715744](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/607715744)
- TemperatureSensor - [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609026248](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609026248)
- TemperatureSetpoint - [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609059077](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609059077)

The commands for all the above-mentioned devices are included in the driver ver 1.00.

**Total number of all devices** which can be connected by Z-Wave to Vera is **253**.

The driver in its version 1.00 is based on the current **Vera firmware**:

- UI7 Version 7.0.22 (1.7.963/1.7.3014/1.7.3015/1.7.3016) | August 3, 2017
- Vera3, VeraLite, & VeraLite G: 1.7.963 - file:"rt3662_Luup_ui7-1.7.963-en-mios.squashfs"
- VeraEdge: 1.7.3014 - file: "mt7620a_Luup_ui7-1.7.3014-en-mios.squashfs"
- VeraPlus: 1.7.3015 - file: "mt7621_Luup_ui7-1.7.3015-en-mios.squashfs"
- VeraSecure: 1.7.3016 - file: "mt7621s_Luup_ui7-1.7.3016-en-mios.squashfs"

These firmware files are also included in the ZIP archive in the ”Documents” section of this driver. Note that mostly the Vera devices can be uploaded by this firmware only after setting it into factory default as downgrade is not supported!

# Vera device driver

The Vera is communicating with the control system using the TcpClient port and it is equipped with one VeraZ_Wave port. This port can be used to connect specific device drivers of required types.

The CVC project Configuration could look e.g. like this:

![image](media://7939528d-fec3-40db-8a1d-3b5b62400ab1)

# Communication

The driver is starting the communication at the Init() of this driver. Immediately after establishing connection the driver starts device ID scanning - collecting information about all nodes included in the Vera project. This process can take several moments. The time for scanning can be limited by setting the property “Max device ID” to the real value according to the real project (see below).

The function “isVeraReady()” can be used to check if the driver has already finished the scan. It returns TRUE when scanning had been finished. When not ready or the scanning is in progress then it returns FALSE.

# Properties

|  |  |  |  |
| --- | --- | --- | --- |
| Property name | Data type | Default value | Description |
| Connection |
| IP | Text | 192.168.1.100 | IP address of the Vera device. The format is e.g. like this 192.168.1.55. |
| Port | Long | 3480 | TCP port of the Vera device |
| Z-Wave Settings |
| Max device ID |  | 50 | Maximum ID used for Z-Wave devices in the network. This property can be set in range 3-253. The value 253 is the maximum number of Z-Wave devices which can be connected. Note that usually the real max ID seldom exceeds 50 and reducing this number to real value for each application would speed up scanning which is performed after each reset. |
| Debug |
| Debug Print | Boolean | No | Yes/No enables/disables the debug prints report from the driver |

# Events

This driver is not generating any events.

# Commands for the VeraZ_Wave channel

## General commands

### isVeraReady                               

Returns TRUE if the initialization of the communication with Vera is finished and ready for use - otherwise returns FALSE. Typically it can be used to check if the driver has already finished the scanning which is performed after each reset.

#### Syntax

```visualbasic
Function isVeraReady() As Boolean
```

#### Return value

Returns TRUE if the initialization and scanning were finished and Z-Wave is ready for use - otherwise returns FALSE

#### Example

```visualbasic
If Vera1.VeraZ_Wave1.isVeraReady( ) Then
  // ...
End If
```

### RecallScene                               

This command is invoking Scene.

#### Syntax

```visualbasic
Function RecallScene(iSceneId As Byte)
```

#### Parameters

iSceneId

<u>Byte</u> id of the scene to be recalled

#### Example

```visualbasic
Vera1.VeraZ_Wave1.RecallScene(5)    
//causes Scene with id:5 to be recalled
```

## SwitchPower1 commands

### SwitchPower1_GetStatus

This command reads the current status from Z_Wave device of type SwitchPower1

#### Syntax

```visualbasic
Function SwitchPower1_GetStatus(id As Byte) As Byte
```

#### Parameters

id

<u>Byte</u> id of the SwitchPower1 device which is to be addressed by this command (see Appendix A)

#### Return value

 current status - where 0 means OFF, 1 means ON

#### Example

```visualbasic
iLevel :=Vera1.VeraZ_Wave1.SwitchPower1_GetStatus(6)
//reads status of SwitchPower1 device with id:6
```

### SwitchPower1_SetStatus                               

This command sends new status to Z_Wave device type SwitchPower1

#### Syntax

```visualbasic
Function SwitchPower1_SetStatus(
  id As Byte,
  iNewStatus As Byte)
```

#### Parameters

id

<u>Byte</u>  id of the SwitchPower1 device which is to be addressed by this command (see Appendix A)

iNewStatus

<u>Byte</u> new status where 0 means OFF, 1 means ON

#### Example

```visualbasic
Vera1.VeraZ_Wave1.SwitchPower1_SetStatus(6,1)
//set ON SwitchPower1 device with I id:6
```

## Dimming1 device commands

### Dimming1_GetLoadLevel                               

This command reads the current output level in percent from Z_Wave device of type Dimming1.

***Syntax***

```visualbasic
Function Dimming1_GetLoadLevel(id As Byte) As Byte
```

***Parameters***

id

<u>Byte</u> id of the Dimming1 device which is to be addressed by this command (see Appendix A)

#### Return value

<u>Byte</u> current level in percent (range 0-100)

#### Example

```visualbasic
iLevel :=Vera1.VeraZ_Wave1.Dimming1_GetLoadLevel(6)
//reads level of Dimming1 device with id:6
```

### Dimming1_SetLoadLevel                               

This command sends new level in percent to Z_Wave device type Dimming1

#### Syntax

```visualbasic
Function Dimming1_SetLoadLevel(
  id As Byte, 
  iNewLevel As Byte)
```

#### Parameters

id

<u>Byte</u> id of the Dimming1 device which is to be addressed by this command (see Appendix A)

iNewLevel

<u>Byte</u> new level in percent (range 0-100)

#### Example

```visualbasic
Vera1.VeraZ_Wave1.Dimming1_SetLoadLevel(6,99)
//set level 99% Dimming1 device with id:6
```

## EnergyMetering1 device commands

### EnergyMetering1_GetWatts                               

This command reads current power consumption in Watts from EnergyMetering1 device

#### Syntax

```visualbasic
Function EnergyMetering1_GetWatts(id As Byte) As Double
```

#### Parameters

id

<u>Byte</u> id of the EnergyMetering1 device which is to be addressed by this command (see Appendix A)

#### Return value

<u>Double</u> current power in Watts 

#### Example

```visualbasic
iPowerConsumption := Vera1.VeraZ_Wave1.EnergyMetering1_GetWatts(16)
//reads power in Watts from EnergyMetering1 device with id:16
```

## SecuritySensor1 device commands

### SecuritySensor1_GetTripped                               

This command reads the current status from Z_Wave device of type SecuritySensor1

#### Syntax

```visualbasic
Function SecuritySensor1_GetTripped(id As Byte) As Byte
```

#### Parameters

id

<u>Byte</u> id of the SecuritySensor1 device which is to be addressed by this command (see Appendix A)

#### Return value

<u>Byte</u> current status - where 0 .. NO presence detected, 1 .. Presence detected

#### Example

```visualbasic
If Vera1.VeraZ_Wave1.SecuritySensor1_GetTripped(6) Then
  // ...
End If
//reads status of SecuritySensor1 device with id:6
```

#### Note

VERA SecuritySensor settings allow distinguishing Tripping when the sensor is in Armed or NotArmed state. The function **SecuritySensor1_GetTripped()** returns its value independently on status of Armed or NotArmed.

## TemperatureSensor1 device commands

### TemperatureSensor1_GetCurrentTemperature                               

This command reads the current temperature from Z-Wave device of type TemperatureSensor1

#### Syntax

```visualbasic
Function TemperatureSensor1_GetCurrentTemperature(id As Byte) As Double
```

#### Parameters

id

<u>Byte</u>   id of the TemperatureSensor1 device which is to be addressed by this command (see Appendix A)

#### Return value

<u>Double</u> - current temperature

#### Example

```visualbasic
iTem := Vera1.VeraZ_Wave1.TemperatureSensor1_GetCurrentTemperature(66)
//reads CurrentTemperature of TemperatureSensor1 device with id:66
```

## TemperatureSetpoint1 device commands

### TemperatureSetpoint1_GetCurrentTemperature                               

This command reads the current temperature from Z-Wave device of type TemperatureSetpoint1

***Syntax***

```visualbasic
Function TemperatureSetpoint1_GetCurrentTemperature(id As Byte) As Double
```

#### Parameters

id

<u>Byte</u> id of the TemperatureSetpoint1 device which is to be addressed by this command (see Appendix A)

#### Return value

<u>Double</u> current temperature

#### Example

```visualbasic
iTemp := Vera1.VeraZ_Wave1.TemperatureSetpoint1_GetCurrentTemperature(5)
//reads CurrentTemperature of TemperatureSetpoint1 device with id:5
```

### TemperatureSetpoint1_GetCurrentSetpoint                               

This command reads the current Setpoint from Z-Wave device of type TemperatureSetpoint1

#### Syntax

```visualbasic
Function TemperatureSetpoint1_GetCurrentSetpoint(id As Byte) As Double
```

#### Parameters

id

<u>Byte</u> id of the TemperatureSetpoint1 device which is to be addressed by this command. (see Appendix A)

####  Example

```visualbasic
iTemp := Vera1.VeraZ_Wave1.TemperatureSetpoint1_GetCurrentSetpoint(5)
//reads current Setpoint value of TemperatureSetpoint1 device with id:5
```

#### Return value

<u>Double</u> Setpoint temperature

### TemperatureSetpoint1_SetCurrentSetpoint                               

This command sends new status to Z_Wave device type TemperatureSetpoint1

#### Syntax

```visualbasic
Function TemperatureSetpoint1_Set CurrentSetpoint(
  id As Byte, 
  iNewSetpoint As Double)
```

#### Parameters

id

<u>Byte</u> id of the TemperatureSetpoint1 device which is to be addressed by this command. (see Appendix A)

 iNewSetpoint

<u>Double</u> new Setpoint temperature

#### Example

```visualbasic
Vera1.VeraZ_Wave1.TemperatureSetpoint1_SetCurrentSetpoint(33,19)
//set Setpoint to 19° on TemperatureSetpoint1device with I id:33
```

#### Note

The Z-Wave Thermostats – the TemperatureSetpoint1 devices are frequently waking up once within rather long period – could be some 20-30minutes or more thus the value of newSetpoint temperature is first stored  in Vera device in variable named “SetpointTarget” and there the value is waiting for new wake up of the thermostat. Then this value is transferred to the device. The actual value of “SetpointTarget” can be checked by function TemperatureSetpoint1_GetSetpointTarget().

### TemperatureSetpoint1_GetSetpointTarget                               

This command reads the current Setpoint Target ( See **Note **by previous command for further details).

#### Syntax

```visualbasic
Function TemperatureSetpoint1_GetSetpointTarget(id As Byte) As Double
```

***Parameters***

id

<u>Byte</u> id of the TemperatureSetpoint1 device which is to be addressed by this command. (see Appendix A)

#### Return value

<u>Double</u> SetpointTarget temperature 

#### Example

```visualbasic
iTemp := Vera1.VeraZ_Wave1.TemperatureSetpoint1_GetSetpointTarget(5)
//reads current SetpointTarget value for device with id:5
```

## SceneController1 device commands

### SceneController1_GetLastScene                               

This command returns ID of the last scene called by this SceneController. If the second parameter of this function is used then the function returns there a time when the last scene has been invoked

#### Syntax

```visualbasic
Function SceneController1_GetLastScene(
  id As Byte,
  Optional mLastSceneTime As AddressOf Time := Nothing ) 
As Byte
```

#### Parameters

id

<u>Byte</u> id of the SceneController1 device which is to be addressed by this command. (see Appendix A)

mLastSceneTime

<u>Address of Time</u>   - optional parameter – If specified then the command returns in this variable the time when the Last Scene was invoked

#### Return value

<u>Byte</u> SceneID of the Last scene started by SceneController1 device

#### Example

```visualbasic
Var mStartingTime As Time
Var iLastScene As Byte

iLastScene := Vera1.VeraZ_Wave1.SceneController1_GetLastScene(7,mStartingTime)
//reads ID of Last scene started by SceneController1 device with id:7
// in time stored in mStartingTime
```