[DRIVER] Zooz ZEN Switches Advanced (and Dimmers)

Going to work on the ZEN22 now, if it is similar to the 27 should have it posted tonight or tomorrow AM.

UPDATES: Updated ZEN27, added ZEN21 and ZEN26. Because Zooz had the version starting with the current hardware version I decided to just reset them all back to a base of 1.0.0 and start clean, so now they will all be in sync and are at 1.1.0. If you had ZEN27 installed already you might have to run a "Repair" in the package manager to force the current version, should not be an issue going forward. ZEN26 is untested as I don't have one, let me know if any issues. It is nearly identical to the ZEN21 which I did test so I suspect it will work fine.

@steve.maddigan Added ZEN22 just now, if you run an update on package manager it should pick it up, it did for me anyway.

1 Like

UPDATE for all drivers:
Added Group 3 Associations
Added support for ZEN23 and ZEN24

I installed these, and I noticed that the Zen27 driver corrects for a firmware bug in version 3.01. The problem is that this bug exists in all versions after 3.01 as well, so line 649 should be:

if (Float.parseFloat(device.getDataValue("firmwareVersion")) >= 3.01) {

The same change should be made to line 628 of the Zen22 driver.

They have their original switches one major version ahead of the S2 switches, so on the ZEN22 it probably only effects 4.01. I dont have one of those to test on. They sent me a pre-release 3.03 for the Zen27 and I confirmed that it is switched back (fixed). You should be able to just copy that code into the ZEN22 for now and change the version number check. I will add it on my next version.

I've been back and forth with them on this topic for a while. I've played around with various firmwares that either do or do not fix it on different hardware (I have Zen21, 22, and 27 in various locations).

They told me that they are not sure which way they are going to go in the future because they are afraid of breaking existing integrations that rely on the buggy behavior, but they plan to add a config parameter to the firmware in the February release to tell the switch which scene number to send for each paddle.

UPDATE
Posted version 1.3.0, changelog in first post.

A little extra info on the new Brightness Correction setting (defaults to off, enable the setting to try it). The LED bulbs I have the useable dimming range is between about 20-70%, anything below is off and above is full bright (to my eyes). It was annoying me that when maxed out to my max setting it would show 70% on the dashboard. So I worked out a little formula to convert back and forth between the set level and the displayed level. If you enable to the new setting and have a min/max set it will do the conversion automatically. Example, min=20 and max=60: normally if you set 50%, the dimmer gets set to 50%, which is very close to the max, so probably almost fully bright. With this new setting the formula converts your setting of 50%, and actually sets the dimmer to 40% which is halfway between the min and max.

//This converts what the user selected into a physical level within the min/max range
level_dimmer = ((brightmax - brightmin) * (level_displayed/100)) + brightmin

//This takes the true physical level and converts to what we want to show to the user
level_displayed = ((level_dimmer - brightmin) / (brightmax - brightmin)) * 100

You can check the event logs to see the displayed level vs the actual level being set

2 Likes

Hey Jeff, thanks a lot for building and sharing this! I installed it yesterday for 2 ZEN21 and 2 ZEN22 switches and it solved a lot of problems for me. I'd love to help out and cover your cost for a ZEN30 double switch if you're interested in adding that to the library, do you have donations set up anywhere?

1 Like

Great to hear it helped solve some issues, I love coding and I love sharing my work.

I was actually thinking about possibly getting a ZEN30, I just got done installing my first round of stuff and I have to plan out my next batch and what I can afford. Started out with 7 switches which covered almost the whole first floor.

I see the same person who I ported the drivers from for these other switches also has the ZEN30 and lots of other Zooz stuff in another folder on his GitHub. So I should be able to port that over and merge in all my changes as well.

Here is a PayPal link if desired: http://paypal.me/JPage81

Are there any plans to implement driver support for the Zooz Zen25?

1 Like

Yes I actually have a ZEN25 to test with as well. I figured the built in driver was working OK (without S2) but I just found a ST driver along with the ZEN30 today so I can use that as my base to start with. I will see what I can do.

3 Likes

Curious why you say the other advanced drivers aren't being updated anymore. @agnes.zooz said just last month that @bcopeland mentioned there'd be an update soon. :man_shrugging:

Thanks so much. Looking forward to testing it.

It is confusing because Bryan (bcopeland) wrote these particular drivers before he was hired by Hubitat. Anything he wrote before he was hired is basically abandoned by him. He has stated that he hopes someone will carry on his previous projects.

The drivers Agnes Zooz is talking about getting updates are most likely the built-in Hubitat supplied drivers.

Out of curiosity, do any of the advanced parameter options here work to get rid of the press delay when scene mode is turned off?
Thanks!!

@hikeit you are looking to get rid of the ramp rate (the fade in/out when turning on/off)? Set the Ramp Rate setting to Instant, and the ZWave Ramp Rate to match the physical ramp rate. That should do the trick if I am thinking of what you want correctly.

I don't think the switches have a ramp rate setting, only the dimmers do.

I just tested my ZEN21 with and without the scene parameter enabled and physically tapping the switch. Both ways seems to be less than a 1s delay to turn on or off, no fade just instant on/off. I don't have any regular switches on a 3-way but if that's how yours is, is it only the extra switch with the delay? When using the secondary switch with my Zen27's I noticed there is a slight delay for the main switch to figure out what happened and to turn on the light. I also remember seeing another thread where someone was having an issue with a normal switch wired to a lamp and it was ramping it up instead of instant for some reason, I think he contacted Zooz support and they got it working right so not sure if it was a wiring issue or maybe a firmware update.

I'm just referring to the built in buttons, not the 3-way operation.
The delay I'm talking about is the "less than 1 second"... it's about 700 or 800 milliseconds from pushing the button to the relay flipping.
If I tell the switch to flip from zwave, it actually switches faster.

@chrismccracken (and everyone)

UPDATE:
ZEN30 Double Switch beta driver posted in GitHub for manual installation at this time (not in package manager). It appears to work 100% for me. I have my ZEN30 sitting here on my desk wired to an extension cord for testing the button presses. All parameters, scene buttons, and associations are supported. I used the same button numbers for the dimmer as the other ZEN switches (1-10), and then for the relay switch I am using (1-5) but sending the event to the child device. So if you want to trigger any RM actions on the relay create the rule on the child. Turn on the info logging to easily investigate what any of the button numbers are.

There are a few things with the child device stuff, and multichannel where I am not really loving the code from the original driver. I also am having a hard time making sense of what some of it is doing exactly, first time with multichannel and a child device. I am going to see if I can get some feedback in another post before I make this an official final version.

UPDATE:
Posted ZEN30 v1.3.2 to GitHub and added to Package Manager. Got most of my concerns worked out and it seems to working pretty solid in my testing. Tested with firmware 1.05 and 1.07 paired with S2 (not sure what changed in 1.07 yet but Zooz wanted me to try it). If you already had the beta installed if you run a Match Up in HPM it should find it.

Next Up: almost done adding the ZEN76 and 77 to the lineup. Will be 1.4.0 and all the switch drivers will merge, and the dimmer drivers will merge into two universal Zooz drivers (similar to the stock drivers). Less drivers for you, easier to keep the code in sync for me.

1 Like