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

---

The **SceneController1** device is to be used when input devices like pushbutton devices and Z-Wave wireless mobile controllers and hand-held remoters are to be used. These controllers can be set in a mode where all buttons used are just to recall some predefined Scene in the Vera controller. This exact setting must be used when the usage of this driver is supposed. How to set the Z-Wave controllers and Vera device is a little tricky, but mostly it can be found on Internet. As an example of the one most popular remoters - the setting for four-button KFOB hand-held Z-Wave remoter is described in [https://cue.atlassian.net/wiki/spaces/CVCDD/pages/619446776](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/619446776).

# 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. |
| Debug |
| Debug print | Boolean | No | Yes/No enables/disables the debug prints report from the driver. |

# Events

## NewSceneRunning

This event is generated whenever the driver recognizes that new scene was recalled from this SceneContoller1. The current status of this SceneContoller device is pooled periodically in time Period property (see above).

#### Syntax

```visualbasic
Event NewSceneRunning As Process(newSceneID As Byte)
```

#### Parameters

newSceneID

[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte) - new Scene ID recalled from this SceneController (see [Note 1](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609255630/Z_Wave_Vera_SceneController#Note-1))

#### Example

```visualbasic
Process Z_Wave_SceneController1_NewSceneRunning(newSceneID As Byte) Link Z_Wave_SceneController1.NewSceneRunning0
  DebugPrintFormat ( "Starting NEW Scene: {n}",newSceneID)
End Process
```

# Commands

## GetMyID

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

#### Syntax

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

#### Return value

Byte  -  ID in range 3-255

#### Example

```visualbasic
Id := Z_Wave_SceneController1.GetMyId()
//reads ID of this SceneController1 device
```

## GetLastScene

This command returns ID of the last scene called by this SceneController (see [Note 1](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609255630/Z_Wave_Vera_SceneController#Note-1)). If the second parameter of this function is used then the function returns into this variable the time when the last scene was started

#### Syntax

```visualbasic
Function GetLastScene (Optional mLastSceneTime As AddressOf Time := Nothing) As Byte
```

#### Parameters

mLastSceneTime

AddressOff <u>Time</u> - Optional parameter. If specified then the command returns in this variable the time when the Last Scene was started.

#### Return value

Byte - SceneID of Last scene started by SceneController1 device (see [Note 1](https://cue.atlassian.net/wiki/spaces/CVCDD/pages/609255630/Z_Wave_Vera_SceneController#Note-1))

#### Example

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

iLastScene :=Z_Wave_SceneController1. GetLastScene(mStartingTime)
//reads ID of Last scene started by Z_Wave_SceneController1 device
// Scene starting time is stored in mStartingTime variable
```

#### Note 1

The SceneID need not be exactly the same value as the scene “id” which can be found in Vera Project. Vera device could report these Scene ID shifted by some value depending on exact SceneController configuration and number of SceneControllers used in the project. 

> ℹ️ It is strongly recommended to use DebugPrints in each project to check which exact values is the Vera device reporting as SceneIDs when starting particular scene from this SceneController.