=====Home Seer WD200+ Dimmer===== {{:supported_modules:hs-wd200.jpg?direct&400 |}} The HS-WD200+ is Home Seer’s latest wall dimmer. In addition to all the commands and support of the [[supported_modules:hs-wd100|WD100+]] dimmer it adds 2 more central scene gestures. Note that the gesture codes are different between the 2 switches however. It can send us the 4 click and the 5 click gestures. See the article on the [[supported_modules:hs-wd100|WD100]] for more info on it’s central scene handling and how to work with that in XTension. NOTE: as of Vera firmware version 1.7.4452 Vera Edge / 1.7.4453 Vera Plus / 1.7.4454 Vera Secure they have changed the gesture codes that are received from this switch. They are now the same as they were for the WD100+ dimmers with the addition of the extra multi-click supported. The available Central Scene gesture codes on the WD200+ dimmers are: ^Gesture^Code^Code Prior to 1.7.4 vera update^ |Single Click|0|128| |Double Click|3|131| |Triple Click|4|132| |Hold|2|130| |Release of Hold|1|129| |Quadruple Click|5|133| |Pentuple Click|6|134| The button code of the UP paddle is always 1 and the down paddle 2 so the combination of those two data points will let you trap any gesture from either paddle and perform different actions based on them. The single click always controls the local load, but the other multi-clicks do not control the local load but only send the centra scene event. If you wish to do a sort of “all off” with a double click down you will have to script the changing of the load as well. Something like this example might be used to control all the rooms lighting with a double click while still being able to control the dimmer locally without affecting the whole room if you wish. on centralScene( theButton, theGesture) if theButton is equal to “1" then write log “the top paddle was pushed" if theGesture is equal to “3" then -- the switch was double clicked on write log “double click ON, turning on room lights" -- since the switch doesn’t control it’s local load when doing a double click the first thing we should do is control it turnon (thisUnit) brighten “other room light” to 75 turnon “yet another light in the room" end if else if theButton is equal to “2" then write log “the bottom paddle was pushed" if theGesture is equal to “3" then write log “double click OFF. turning off the room lights" turnoff (thisUnit) turnoff other room light" turnoff “yet another light in the room" end if end if **Hubitat Notes:** Note that with the current built in driver on the hubitat only tap and double tap are available. I am looking into the possibility of using a user created driver or creating one myself that will properly support that for us. At the moment you are limited to that. ===Controlling the RGB LED’s with a Hubitat=== The hubitat and the vera have incompatible ways of sending such commands to the device so you must use a different method for the hubitat than the Vera did. First make sure that the device in the Hubitat is setup to be using the built in Home Seer WD200+ Dimmer driver. Then make sure that the switch in the control page under preferences for that device labeled “Enable Status LEDs” is turned on and save the configuration if necessary. The scripting command we use to send these commands is sendDeviceCommand which is sent directly to the unit like this: tell xUnit “name of your WD200 dimmer” to sendDeviceCommand( “setStatusLED”, “1,red,blink”) you will pass 2 parameters to the command as in the above example. The first is always the string “setStatusLED” and capitalization matters. The second is a comma separated list of 3 values. **it is important that you not place any spaces in this list** The first parameter is the LED number which should be 1-7. The second can be either a number or the name of the color. The valid values are: 0 or off, 1 or red, 2 or green, 3 or blue, 4 or magenta, 5 or yellow, 6 or cyan, 7 or white. The third is whether or not the led should blink. It must be either 0 or 1, or, on or off. Remember not to put any spaces in this list or the command will not be sent. I have had a very issues with this. With the built in driver I cannot reliably get the indicator LED to stay off when no status LED’s are on. It may be necessary to use a user version of the device driver for this. I am still looking into that. ===Controlling the RGB LED’s on the Vera=== The other new feature of the WD200+ is the ability to change the color of the LED’s that display the level, or to control the color and the flashing of them individually to give a status display. XTension 9.4.6 adds support for changing all those settings via the new [[supported_hardware:veraui7#set_data|setData command]] This is a low level command that sets parameter or variable data directly in the devices memory. If you get the parameter index wring or send bogus data it is entirely possible to brick the dimmer or cause other problems. If you send a command meant for one kind of device to one that doesn’t support that the results will be unpredictable at best. XTension so far does no validation of the data being sent. ====Set Data==== The format of the Set Data command is this: tell xUnit “name of a unit” to setData( parameterIndex, byteCount, theData) to change the default color of the LED’s in the WD200 to blue you’d issue a command to parameter 14 with a single byte of data indicating the color, something like: tell xUnit “name of a WD200+ unit” to setData( 14, 1, 3) valid values for the color data are: * 0 = White * 1 = Red * 2 = Green * 3 = Blue * 4 = magenta * 5 = yellow * 6 = cyan The [[https://homeseer.com/wp-content/uploads/2018/06/HS-WD200-Manual-5.pdf|User Manual]] lists many parameters I’ll include the most useful ones in this table. All parameters are single bytes so the middle value in the SetData command for all these would be 1. Be careful when sending these commands. All manufacturers and possibly different models of the same switch may have different parameters for the same functions. Sending an out of range or incorrect value to a parameter could have unpredictable results or could brick your switch. It’s nice to note however that the WD100 an WD200 share the same parameter number for orientation and it’s other parameters go up through 10, the other WD200 parameters start at 11 so if you confuse the 2 device types when setting data they happily ignore the out of range parameters and do not do anything damaging. ^parameter^Description^Value^Example^ |4|Switch Orientation|0=normal, 1=upside down| setData( 4, 1, 1) to turn it upside down| |11|Ramp rate for remote commands|0-90 the number of seconds to reach the new light level when being controlled remotely|setData( 11, 1, 10) would set a 10 second ramp rate| |12|Ramp rate for local control|0-90 the number of seconds to reach the new level when controlled from the switch manually|setData( 12, 1, 0) would set an instant transition with no fade| |13|Led Display Mode, can be normal to display the local load level, or “status” mode where you can control each LED and color individually|0=Local load level 1=Status Mode|setData( 13, 1, 1) puts you into status display mode so you can control the LED’s| |14|Sets the Normal Mode LED display color as used to show the local load level|0-6 to indicate color as already listed above|setData( 14, 1, 3) sets the default color to blue| |21|Status Mode color of LED 1 (bottom)|The color of this LED when in Status mode as set by parameter 13. Possible values are from 0 to 7. 0=Off, 1=red, 2=green, 3=blue, 4=magenta, 5=yellow, 6=cyan, 7=white|| |22| Status Mode Color of LED 2|:::|:::| |23| Status Mode Color of LED 3|:::|:::| |24| Status Mode Color of LED 4|:::|:::| |25| Status Mode Color of LED 5|:::|:::| |26| Status Mode Color of LED 6|:::|:::| |27| Status Mode Color of LED 7|:::|:::| |30| Flash Speed. Any of the LED’s can be assigned to flash or not flash. Only 1 flash speed is supported at a time via this parameter.|0=No Blinking, 1=100ms rate (fast blink) valid values from 0-255 but useful values are probably up to 10 or so.|setData( 30, 1, 1) sets a fast alert flash| |31|Bitmask to turn on or off blinking for each LED. You could use the text to number command to build the bits.|valid values are from 0 to 127|setData( 31, 1, text to number “&b0010000”) would set only the 5th led to flashing. text to number “&b1111111” would set all LED’s to flashing. setData( 31, 1, 0) would stop all flashing.| ====Turning off all the lights==== While there doesn’t seem to be a way to make the lights not show at all you can now do that with the status mode. Turnon the status mode instead of the level mode and just set every LED to off.