...if I use the automation browser to change a lights brightness property, the light doesn't update until I let go of the up or down button. ..
That's by design. After you release the button, Premise transmits the desired brightness level to the lighting device. To have the brightness change while you are pressing the button, Premise would have to transmit a continuous stream of commands to the lighting device. This is not a practical proposition when it comes to PLC lighting technologies.
I've been working on the transformable classes (i.e. convert an existing Switch object into a Dimmer and vice-versa) and on
Groups.
The inheritance hierarchy for lights looks like this:
Device (Base Class for all zWave devices)
Lighting (Base class for all zWave lights)
Switch (Inherits from Device, Lighting, and Premise's Power class)
Dimmer (Inherits from Switch and Premise's Dimmer class)
I've defined Device to be
Transformable so it can be changed to whatever is needed ... from Switch to Dimmer and back to Switch (or even a Thermostat!). The transformation can be performed by the end-user, using Builder, or it can be done programmatically. The attached
zWave2.xdo contains an example of transformation. Import it and it will also create a zWave object in Devices > CustomDevices and in its
Devices container you'll find two properties:
- SwitchesToDimmers
- DimmersToSwitches
If you click the first one, it will convert all Switches in the Devices container into Dimmers. Now that's a completely useless feature that should never make into the final release but it demonstrates how easily transformation can be accomplished. Here's how it's done:
Code:
for each oDevice in this.GetObjectsByType(Schema.Modules.zWave.Classes.Switch.Path, false)
set oDevice.Class = Schema.Modules.zWave.Classes.Dimmer ' <-- This is the line that does the magic.
next
Add a few
Dimmers,
Switches and
Thermostats into the
Devices container. You'll notice that the driver creates an "
AllLights" group and automatically populates it with all of the Lighting Devices you created in the Devices container. The AllLights group cannot be deleted and its members cannot be renamed nor deleted.
If you right-click the Groups container, you can create a new Group. Name it what you wish then right-click it and add new GroupMembers. Within the GroupMember, click Device and select an existing Device. That's how you build your own groups of devices.
If you change the name of a Device (in the Devices container), its name in AllLights will update automatically. If you delete the Device, it will be automatically removed from AllLights. The auto-renaming and deletion also applies to any Groups you created manually.
Now here's the fun part, if you inspect a Group you'll find it contains PowerState and Brightness properties. If you enable PowerState, it will compose a command to turn on all lights in that Group. OK, that's not fully functional yet, but it does build a list of Device addresses (and prints them to the Debug Console).
A script can turn on all the lights using the following command:
Code:
Devices.CustomDevices.zWave.Groups.AllLights.Powerstate = true
I have a few more ideas about Groups (that may involve the ViziaRF's group commands) but its almost 2:00 AM and its time to call it a day! I think I can incorporate Groups into your driver after you've finished testing all of the core functionality (I don't have any Z-Wave equipment).
BTW, I reviewed CQC's Z-Wave driver and learned there's another possible response command: "<!000". That makes
two more commands to add to gViziaParser (the other is "<M000"). I'll take care of that next week.