Leviton VRCZ4-MRZ 4 button scene controller (again)

Hi All…

For years I had been using Leviton 4 button scene controllers with my Smartthings installation. I had been using a device handler I wrote. It all would allow me to press a button to trigger a scene. Recently, this all stopped working. I have read a few other threads and it seems some firmware on the hub changed at some point. Now I need to get this all working again and I really don’t remember how this all works.

I have read some other threads and am confused. My devices are old, 4 button scene controllers without a relay. There is an up/down rocker button. These devices are powered by 110VAC and do not connect to any loads.

The smartapp I have been using is CORE.

I have been trying to get this to work, no joy. If someone could tell what device handler and smart app to use I would greatly appreciate it.

Thanks!

Update: Here is some data from the log on the device:

  • Manufacturer ID: 001D
  • Product Code: 0206
  • Product Type: 0801
  • currentButton: 0
  • manufacturer: Leviton
  • numButtons: 4

Can you post a picture of the device so we can see whether it is the S model or the Z model? (they have a different design, so we can tell from the case)

Thank you, sure, do you need just the front or the entire device?

Just the front, we can tell from the button layout

I think the bottom rocker switch had two covers, with and without the IR opening, to choose from. These should all be the same device.

Ok, that’s the Leviton VRCZ4-MRZ.

I’m pretty sure it stopped working because the way button capabilities are handled in the new app is different than the classic app, but somebody else is going to have to help you with the code since groovy doesn’t work well with text to speech.

Can you post your code? It’s Probably going to have to be rewritten for the new app.

@mwav3 has done these updates for several different devices, he might have some ideas.

Sure I can take a look.

@helios ideally if you can post the code to Github and just link it here I can probably help getting it working for you.

Also, you can take a look at some updated code on my github page if you want to try making the changes yourself. Take a look at this one specifically for a multibutton device -https://github.com/mwav3/smartthingscode/blob/master/devicetypes/mwav3/gocontrol-wireless-remote-switch.src/gocontrol-wireless-remote-switch.groovy

As @JDRoberts pointed out, the new app handles button values different then the old one. The “supportedbuttonvalues” field was updated and must be communicated as a JSON object. The values used should match the list here - https://smartthings.developer.samsung.com/docs/api-ref/capabilities.html

With the help from others in the community, I updated some old device handlers by doing an import off the bat in the code:

import groovy.transform.Field
import groovy.json.JsonOutput

Then sending the button values in the updated method as a JSON list:

 sendEvent(name: "supportedButtonValues", value:JsonOutput.toJson(["down","up","up_hold","down_hold","up_2x","down_2x","up_3x","down_3x"]), displayed:false)

Then everything can just be programmed to button 1 (even though you have 4 buttons), and assign a different “value” to each of the 4 buttons. For example with your 4 buttons you can do the top as “up_2X”, 2nd from the top as “up”, 3rd from the top as “down”, fourth from the top as "down_2x), etc. Then use the createEvent to send the different values like this:

      createEvent(name: "button", value: "up", data: [buttonNumber: 1], descriptionText: "$device.displayName button up was pushed", isStateChange: true) 
1 Like

Thanks to you both very very much! I’ll post my code to github, I just have to make sure I don’t interfere with my work stuff and I’ll post the link. I’ll study all your comments carefully also.

Not too impressed with Samsung for breaking backward compatibility.

Thanks!

Did they also break CORE somehow? Last night I installed a few new device handlers and I could not get CORE to detect any conditions.

@mwav3 here is a link to my handler. I slapped it together years ago, and I don’t recall what I used as a starting point. It’s a bit sloppy.

Core was deprecated by its author about two years ago and everything since then has been done on Webcore instead. I was actually surprised that core ran at all anymore.

There are many active Webcore users, they even have their own forum, so you might check with them.

FAQ: What is WebCoRE? (And what was CoRE?)

@helios

The easiest solution probably would be to get it working in the smartlighting app. Do you have the smartlighting app? Just asking since it might not be in all countries. If no smartlighting app then as @JDRoberts suggested , webcore. Core is definitely before my time with Smartthings so I don’t know anything about it.

The way the handler works and relies on the button numbers throughout its code, it would be difficult to get it fully working in the automation part of the new app directly, but I should be able to get it working in webcore or smartlighting for you. Let me know if either are an option for you.

1 Like

@JDRoberts Ha! Shows what I know, I guess I have been away from all this for quite a while. I’ll look at converting my pistons to the new webCore.

@mwav3 I don’t know what the smartlighting app is but I’ll find it. I think all my handler did was launch an event when a button press was detected. That would be fine, all I would need to do is set up some webCore pistons to respond to the published events by launching scenes.

In fact this may already be working. As I was testing last night I tried a few different device handlers and I saw that there were button events logged from my device as I pushed the buttons, but I was unable to create Core pistons. Now I know why.

If my handler is easy to fix, great, or if there is an existing handler great as well. I’ll install webCore.

Thanks!!

1 Like

It will log when you press but I don’t think the presses will come through to smartapps (like webcore or smartlighting) as an event without the update to add the “pushed” supported button value.

It should be an easy enough fix with just a few new lines of code. I forked it and will work on getting an update to you. If for some reason it does just work in webcore without an update though let me know.

1 Like

SmartLighting (also called SmartLights) is an official feature created by the smartthings engineering staff. At present, it is the only smartapp that is distributed with the hub firmware, and therefore can run locally. It is supposed to be distributed automatically to every new customer in the US or the UK, but it is not available in all countries. And you can delete it, which some people do by accident.

To get to it, click on the three horizontal line icon in the top left of the home screen, then choose “smartapps” And if you already have the smartlighting Smartapp you should see it there.

It works a little differently than other smartapps which is why it will work with some DTHs that are left over from classic and haven’t been updated yet.

They’ve added a lot of functionality to it over the years, so now many people will try to use it first, since that will give them local operation. Then if they find they can’t do what they want with it, they will go over to webcore or the custom Automation creator that you get if you tap on the + in the upper right of the home screen.

1 Like

@mwav3 okay I got it working, but it’s very very slow. I think the issue may relate to setting the lights on the controller, as that seems to be the slow part. Once the LED resets the action happens. Does that make any sense?

@JDRoberts thanks for explaining! I’m finding the webCoRE is a bit slow so since this app runs locally I’ll give it a try and hope its a bit quicker. Thanks again!

UPDATE: I installed that app, but when I try to set up a trigger, I can select “button” and then I am prompted for “which button” in which case I can then select the entire scene controller, but not a particular button on it.

I suspect this is a device handler issue…

1 Like

Yes that definitely is from the missing supported button values. Once I add the code it should fix that.

Your code has a check built in to disregard duplicate button events from a single press. Multiple methods are also called when a button is pressed. Theres a lot of debug logging too. All these things will add up to create delays. Some may not be necessary and probably can be cleaned up. We’ll try to get it working with the smartlighting app first then go from there.

1 Like

I found a more updated device handler from @BrianAker for this device. I added code to it to add the supported button values to hopefully get it working with the new app (hope he doesn’t mind) so it will work with smartlighting and/or webcore. The code looks like it will work a lot better then the older one you were using. To get it and give it a try the link is below, let me know of it works:

Note - when you add the code, you will have to go into device settings and toggle all the preferences to force everything to update - there’s preferences to enable each button that must be set to true for all of them.

1 Like