[ST EDGE] VRCS4 (M0Z and MRZ) Device - Release

SmartThings Edge Driver for Leviton VRCS4-M0Z and VRCS4-MRZ(Release)

Changes since Beta Version

  • Each switch is now dimming switch capable (no need to configure Z-Wave devices in Settings)
  • Dimming is now integrated into SmartThings (Settings provides Dimming Duration Control)
  • Stability improvements
  • Have Rules template to integrate each switch into an automation

Edge Driver implements the Leviton VRCS4 device as a group of 4 on/off switches controlled by corresponding buttons on the VRCS4 device. Using SmartThings allows you to configure routines to integrate each switch to control other SmartThings devices.
The VRCS4 is an older device and discontinued by Leviton. I have a couple of them, they have yet to fail, and are very convenient to use as a 4-switch device in a single gang footprint. While originally intended as a Scene Controller by Leviton, this was converted to a 4-port switch using a Groovy DTH several years ago. I have adapted this into an Edge Driver and added a few refinements.
This driver supports the Leviton VRCS4-M0Z and VRCS4-MRZ models of the switch consisting of 4 buttons (with LEDs) and a dimmer toggle.

  • M0Z consists of 4 switches and a dimmer toggle. The device does not contain an embedded load.
  • MRZ consists of 4 switches, dimmer toggle and includes an embedded load. When you pair the MRZ into SmartThings, two devices are actually created. The scene controller which will use the VRCS4 driver and a Z-Wave switch which will control the internal load.

The basic features of the VRCS4 as implemented in this driver.

  • The device exposes four independent On/Off dimming switches which can be controlled either from the device or via the SmartThings UI
  • LEDs are automatically controlled based on the state of the switch (LED is on when the switch is on)
  • Enabling Sync (in Settings) allows multiple VRCS4 switches to be paired for 3-way or multi-way operation. Any device, with Sync enabled, will mirror switch operations on all device that have Sync enabled. Out of box, Sync is disabled such that each Leviton VRCS4 device is managed independently.
  • Dimming is supported using the bottom button. Dimming up will automatically turn the switch on if it is currently off. Dimming Duration in the Settings panel allows you to control the dimming rate. For example, setting the Dimming Duration to 10 will result in a full dimming cycle (from 100 to 0) taking 10 seconds. The default is 8 seconds.
  • Dashboard displays the state of Switch 1.

Fingerprints

  - id: "Leviton ZRCS4"
    deviceLabel: Leviton 4 Button Switch
    manufacturerId: 0x001D
    productType: 0x0802
    productId: 0x0261


  - id: "Leviton ZRCS4-M0Z"
    deviceLabel: Leviton 4 Button Switch
    genericType: 0x01
    specificType:
      - 0x00
    commandClasses:
      supported:
        - 0x2D

To install

  • Use the channel link to enroll install the driver on your hub.
  • Use the SmartThings app to exclude your device (there is currently no way to switch from a Groovy DTH to an Edge driver except by deleting and then adding the device).
  • Use Add device → Scan nearby in the SmartThings app to include your device. Your device should pick up this driver if the fingerprint matches.

Code

github.com:
GitHub - harobinson/SmartThings-VRCS4

Settings

  • Sync: Turning on Sync will create an equivalent of an n-way switch for all VRCS4’s in your hub what have the Sync option available. E.g. turning on a switch will be mirrored on every other Sync’d VRCS4 (corresponding switch will be turned on and LED will be lit).
  • Dimming Duration: Number of seconds to change level from 100 to 0 when dimming switch is held down (default = 8 seconds)

Caveats

  • Automation Routines: While you can select any button in the IF clause, only the Switch 1 can be selected in the THEN clause.
  • Scenes: Only Switch 1 can be selected for an Action in a scene.
  • You can alternatively use Rules which doesn’t have this restriction. This has been reported as a bug/feature to SmartThings.

Rules

As the switches simply control their internal state, it is natural to associate the switch state with other physical switches or devices. The rule template below will mirror a VRCS4 button with a dimming switch. The rule consists of six actions:

  • If the VRCS4 button changes to On, then set the target switch to On.
  • If the VRCS4 button changes to Off, then set the target switch to Off.
  • If the VRCS4 button’s dimming level changes, then change dimming level of target switch.
  • If the target switch changes to On, then set VRCS4 button to On.
  • If the target switch changes to Off, then set VRCS4 button to Off.
  • If the target switch dimming level changes, then change dimming level of the VRCS4.

To use this rules:

  • Copy the rules below"
  • Substitute all occurrences of to the VRCS4 device id. “Make sure to remove the angle brackets.”
  • Select “main, switch2, switch3, or switch4” in the component field currently marked <main, switch2, switch3, or switch4>, remove the angle brackets
  • Create a separate rule for each switch (main, switch2, switch3, and switch4)
  • Install the rule either using the smartthings cli or using the Smartthings API Browser — https://api-browser-plus.pinsky.us
  • Repeat for each button.

Rules - JSON Template

{
    "name":"Rule Template",
    "actions":[
       {
          "if":{
             "changes":{
                "equals":{
                   "left":{
                      "device":{
                         "devices":[
                            "<VRCS4 Switch>"
                         ],
                         "component":"<main, switch2, switch3, or switch4>",
                         "capability":"switch",
                         "attribute":"switch"
                      }
                   },
                   "right":{
                      "string":"on"
                   }
                }
             },
             "then":[
                {
                   "command":{
                      "devices":[
                         "<Target Switch>"
                      ],
                      "commands":[
                         {
                            "component":"main",
                            "capability":"switch",
                            "command":"on"
                         }
                      ]
                   }
                }
             ],
             "else":[
                {
                   "if":{
                      "changes":{
                         "equals":{
                            "left":{
                               "device":{
                                  "devices":[
                                     "<VRCS4 Switch>"
                                  ],
                                  "component":"<main, switch2, switch3, or switch4>",
                                  "capability":"switch",
                                  "attribute":"switch"
                               }
                            },
                            "right":{
                               "string":"off"
                            }
                         }
                      },
                      "then":[
                         {
                            "command":{
                               "devices":[
                                  "<Target Switch>"
                               ],
                               "commands":[
                                  {
                                     "component":"main",
                                     "capability":"switch",
                                     "command":"off"
                                  }
                               ]
                            }
                         }
                      ]
                   }
                }
             ]
          }
       },
         {
            "if": {
                "changes": {
                    "operand": {
                        "device": {
                            "devices": [
                                "<VRCS4 Switch>"
                            ],
                            "component": "<main, switch2, switch3, or switch4>",
                            "capability": "switchLevel",
                            "attribute": "level"
                        }
                    }
                },
                "then": [
                    {
                        "command": {
                            "devices": [
                                "<Target Switch>"
                            ],
                            "commands": [
                                {
                                    "component": "main",
                                    "capability": "switchLevel",
                                    "command": "setLevel",
                                    "arguments": [
                                        {
                                            "device": {
                                                "devices": [
                                                    "<VRCS4 Switch>"
                                                ],
                                                "component": "<main, switch2, switch3, or switch4>",
                                                "capability": "switchLevel",
                                                "attribute": "level"
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                ]
            }
        },
      {
          "if":{
             "changes":{
                "equals":{
                   "left":{
                      "device":{
                         "devices":[
                            "<Target Switch>"
                         ],
                         "component":"main",
                         "capability":"switch",
                         "attribute":"switch"
                      }
                   },
                   "right":{
                      "string":"on"
                   }
                }
             },
             "then":[
                {
                   "command":{
                      "devices":[
                         "<VRCS4 Switch>"
                      ],
                      "commands":[
                         {
                            "component":"<main, switch2, switch3, or switch4>",
                            "capability":"switch",
                            "command":"on"
                         }
                      ]
                   }
                }
             ],
             "else":[
                {
                   "if":{
                      "changes":{
                         "equals":{
                            "left":{
                               "device":{
                                  "devices":[
                                     "<Target Switch>"
                                  ],
                                  "component":"main",
                                  "capability":"switch",
                                  "attribute":"switch"
                               }
                            },
                            "right":{
                               "string":"off"
                            }
                         }
                      },
                      "then":[
                         {
                            "command":{
                               "devices":[
                                  "<VRCS4 Switch>"
                               ],
                               "commands":[
                                  {
                                     "component":"<main, switch2, switch3, or switch4>",
                                     "capability":"switch",
                                     "command":"off"
                                  }
                               ]
                            }
                         }
                      ]
                   }
                }
             ]
          }
       },
         {
            "if": {
                "changes": {
                    "operand": {
                        "device": {
                            "devices": [
                                "<Target Switch>"
                            ],
                            "component": "main",
                            "capability": "switchLevel",
                            "attribute": "level"
                        }
                    }
                },
                "then": [
                    {
                        "command": {
                            "devices": [
                                "<VRCS4 Switch>"
                            ],
                            "commands": [
                                {
                                    "component": "<main, switch2, switch3, or switch4>",
                                    "capability": "switchLevel",
                                    "command": "setLevel",
                                    "arguments": [
                                        {
                                            "device": {
                                                "devices": [
                                                    "<Target Switch>"
                                                ],
                                                "component": "main",
                                                "capability": "switchLevel",
                                                "attribute": "level"
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                ]
            }
        }

    ]
}

Note:

  • I have sometimes encountered the “flashing” phenomena where the rule seems to loop forever in an off/on sequence. I can solve this by disabling the rule and then re-enabling it. Possible with the Smartthings Browser.

Acknowledgments

  • Brian Dalhem (@bdahlem) for the original DTH groovy code.
  • Jason Brown (@j9brown) for documenting Leviton proprietary command for LED control.
  • The SmartThings community (@jdroberts, @h0ckeysk8er, @philh30) for answering my newbie questions on edge drivers.
4 Likes