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

---

Ver 1.01

The definition of **Dimming1** device is defined as Dimming1 UPnP device type.

Note that most products of this type are combining Dimming1 functionality with SwitchPower1 device type. This adds to Dimming functions also On-Off command.

Both these are supported by this driver.

# 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

## OnLoadLevelChange

This event is generated whenever the driver recognizes the change in the device state (load level). 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 OnLoadLevelChange As Process(newstatus As Long)
```

#### Parameters

newstatus

[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) - status of Dimming1 device where represents load level in percent

#### Example

```visualbasic
Process Z_Wave_Dimming1_OnStatusChange(newstate As Long) Link Z_Wave_Dimming1.OnStatusChange
  DebugPrintFormat ( " NEW status {n}",newstate)
End Process
```

## OnStatusChange

This event is generated whenever the driver recognizes the change in the device state (ON or OFF). 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(newstatus As Long)
```

#### Parameters

newstatus

[Long](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Long) - status of Dimming1 device where value 0  means OFF and 1 means ON

#### Example

```visualbasic
Process Z_Wave_Dimming1_OnStatusChange( newstate As Long ) Link Z_Wave_Dimming1.OnStatusChange
  DebugPrintFormat ( " NEW status {n}",newstate)
End Process
```

# Commands

## GetMyID

This command returns current value of this device property “ID”.

#### Syntax

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

#### Return value

[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte) - ID in range 3-255

#### Example

```visualbasic
Id := Z_Wave_Dimming1.GetMyId()
//reads ID of this Dimming1 device
```

## GetLoadLevel

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

#### Syntax

```visualbasic
Function GetLoadLevel() As Byte
```

#### Return value

[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte) - current level in percent (range 0-100)

#### Example

```visualbasic
iLevel := Z_Wave_Dimming1.GetLoadLevel()
//reads level of Dimming1 device  Z_Wave_Dimming1
```

## SetLoadLevel

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

Syntax

```visualbasic
Function SetLoadLevel(iNewStatus As Byte)
```

#### Parameters

iNewStatus

[Byte](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Byte) - new level in percent (range 0-100)

#### Example

```visualbasic
Z_Wave_Dimming1.SetLoadLevel(99)
//set level 99% on Dimming1 device Z_Wave_Dimming1
```

## On

This command send “ON” to Z_Wave device type Dimming1 (Mostly it is implemented in controlled dimming devices like command to go to level set by previous command which was setting level other than 0 - but depends on particular implementation in each device).

#### Syntax

```visualbasic
Function On()
```

#### Example

```visualbasic
Z_Wave_Dimming1.On()
//set ON this Dimming1 device
```

## Off

This command send “ON” to Z_Wave device type Dimming1(Mostly implemented as setting output load level to 0).

Syntax

```visualbasic
Function Off()
```

#### Example

```visualbasic
Z_Wave_Dimming1.On()
//set ON this Dimming1 device
```