[RELEASE] Leviton ZW4SF Driver

Disclaimer: I've never written a line of Groovy in my life until this evening. Spent a few hours hacking away on a Decora Dimmer driver shared a few years back by Jason Xia that looked like it was maybe ported from SmartThings. Did a bit of reading, took a stab at cleaning that up and making a proper "fan" driver for this. Unfortunately the enum that comes with FanControl capability has a few entries in it that don't match up with this 4-speed controller's options.

Anyway, hope it helps someone, or (more likely) that someone comes along and fixes my bugs. :smile:


Following up to say that I was delighted to discover that this driver finally has cured my fan switches of being perceived as lights by Alexa. So I can stop getting stuck in a wind tunnel when I ask her to turn on the lights. :joy:


Added this driver to HPM, for folks who prefer this way of installing.

Thanks for the driver! I see that you said Alexa recognizes this as a fan, but my Google Home still thinks it's a light. Is this fixable? Thanks!

No idea. I don’t own any Google Home devices. The driver should be exposing itself as a fan controller, so I assume it should work if the Google device supports it? I did a quick search and found this, don’t know if it’s related: https://www.reddit.com/r/googlehome/comments/daim9k/cant_control_ceiling_fan_speed/

Thanks! This fixed the mapping of the levels for me. The built-in Leviton Fan Controller driver wouldn't go to the max level even if I asked for "high". However, with both the built-in driver and with yours, Alexa says, "I'm sorry, something went wrong." after most commands. The first command actually works, but then I get this error. Then subsequent commands sometimes result in another error like the one I get when the internet is down, but it resolves in a minute or so. I'm not sure if this is due to Alexa's fan interface, the Hubitat skill, or the driver.

I’ve found that Alexa is very sensitive to how you issue commands. I think I remember reading that it had to do with devices that implemented more than one interface.

In any case, when I say “Alexa, set the living room fan to off” I get the correct result, whereas “Alexa, turn off the living room fan” spouts that something went wrong (but works). My guess is that the first functions through Alexa’s “this is a fan” code path and the other functions through its “this is a switch” (but wait, this is ALSO a fan?! Something must be wrong!) code path.

1 Like

Download the Hubitat app