[DRIVER] Zooz ZEN Switches Advanced (and Dimmers)

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

Can you squeeze ZEN71 into your backlog please?

1 Like

I should be able to include the ZEN71/72 into the universal driver I am working on for 1.4.0 pretty easily. I did not even realize they had a ZEN71. They did not have their docs posted for the 76/77 until I asked about it this week. I will see if they can post the ZEN71/72 info as well. @Richard.Albert.Bryan can you switch your driver to "Device" press the Get Info button then send me the fingerprint that it logs (PM is fine).

I am getting close to having the ZEN76 working good, a few kinks to work out with the way a couple things have changed from the other switches. Otherwise very similar.

1 Like

Thanks for writing these drivers. I'm using them for my ZEN21 and ZEN27 devices -- will be adding the ZEN7x devices shortly. Replacing all 50+ switches in my new house (been in for 12 months now).

Is there any reason why the max dimmer value can't have a 100% value included? Go ahead and keep the 99% as default if you wish.

I've been editing your driver code to add can certainly edit the code to add this to the enum list, but as you do updates, I loose this and then have to edit again.

1 Like

The actual max value for the param is 99% per the docs. I have not tried setting it to 100 but it might not like it. There is validation in the code that checks to make sure the level itself is never set higher than 99 as well but it reports back to the user it is 100% visually. I could just change the name of the 99 setting to show 100% in the dropdown menu? Or are you actually setting the param to 100? Want to share your code with me using something like https://codeshare.io/ and I will check it out for my next version. (Can PM me the link).

My PC is down right now, but if you do a SetLevel to 100 from the commands at the top of the device page fir a ZEN27 you will see it goes confirms 100%. And there’s a subtle change on my fixtures when I do that. It helps me with the wife acceptance factor who doesn’t even like my dimming at all, lol.