Zooz ZEN32 Scene Controller for Timed Exhaust Fan Control

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

This blueprint supports the Zooz ZEN32 Scene Controller with the Z-Wave JS integration to control an exhaust fan (like in a bathroom). It supports several modes:

  • On without a time set
  • 60 minutes
  • 45 minutes
  • 30 minutes
  • 20 minutes
  • 10 minutes
  • Off

The LED indicator on the scene controller will update to show what state it is in, so you can label the buttons and it will let a user see how much time, at most, is left before it turns off. It copies the behavior of non-smart timers for fans that many might already have installed in their bathrooms.

You can see the automation source code on GitHub: https://github.com/sdwilsh/ha-zen32-exhaust-fan-blueprint

Prerequisities

This blueprint requires a Timer entity to track the remaining time on the fan, as well as a Switch entity that controls the fan (which can be the scene controller’s on/off switch).

Issues or Suggestions

Feel free to post here, or create an issue in the GitHub repository.

Original Inspiration

I got the original concept from u/louislamore in this Reddit thread.

2 Likes

Really nice work! I like your idea of switching the lights on and off as time decreases.

The only change is make is making the times parameters.
In my case I prefer 5, 10, 15, 30 and 1 hour for the big button (which I configured directly in the parameter)

It’s certainly doable to make that work, I just didn’t want to add that complexity for my initial version. I filed #12 to track the feature request, but it might be a bit before I get to it.

1 Like

I was thinking about it last night… replacing the minutes by variables shouldn’t be hard (could be an options input)… but I think validations would need to be added to make sure that the times selected go in increments (from button 1 to 5) to maintain the functionality, that’d make it more complicated to test.

Overall, again… great work! I’ve replaced my automation and I’m using your blueprint now… I didn’t have the light transition and it’s a really good idea you had there!

1 Like

One way to simplify it would be to have a simple “max time” setting, and then reasonable intervals based on that. To start, just have a max time of 30 and 60 minutes with the two breakdowns.

With that said, I think the most useful thing to do is make it user programmable. Sadly, there’s no way to do “validations” per se of blueprint inputs, so it’d have to be a check and error message to the log if it were misconfigured.

@sdwilsh I took a stab at forking your blueprint to adjust it to my needs.
I added 5 duration inputs and modified the code to read the times from there.

Also, I have my ZEN32 hardwired to the fan, it looks like when pressing the big button is was triggering the scene control and turning off the fan, but the timer would still be running and the other lights would be on.
I fixed that by introducing the else statement on the code and forcing an event OFF state, I’m not sure it’s the right way, but I tested it and it worked :slight_smile:

  - conditions:
    - condition: trigger
      id: zwave_scene_5
    sequence:
    - if:
      - condition: device
        type: is_on
        device_id: !input scene_controller
        entity_id: !input fan_switch
        domain: switch
      then:
        service: timer.start
        data:
          duration: !input button5_duration
        target:
          entity_id: !input fan_timer
      else:
        event: ZEN32_EXHAUST_FAN_BLUEPRINT_STATE_CHANGE
        event_data:
          scene_controller: !input scene_controller
          fan_switch: !input fan_switch
          fan_timer: !input fan_timer
          new_state: 'OFF'

I’ve learned quite a lot from your code on handling blueprints, never done that before, so thank you!!

Feel free to open a PR and we can work on merging that into the repository!

I’ve learned quite a lot from your code on handling blueprints, never done that before, so thank you!!

This was my first blueprint, so I can relate :smiley:

Wow, this is great. I just installed HA (so am a total newbie) and my first project is controlling my bathroom fan using the ZEN32 and a couple of humidity sensors. Finding this will really help.

I did want to ask about a possible adjustment, or help/advice to make adjustments myself.

Because I’ll be adding separate automation to turn the fan on/off based on humidity difference between bathroom and main floor (far from bathroom), I’d like one of the small scene buttons, ideally bottom right, to be a “Disable FAN Automation” button (showing a red LED) that turns off the fan and disables automation for 60 mins then re-enables automation. I would also want to be able to override the “disable fan” feature if any button was pressed when it was ON, including pressing the “disable fan” button itself.

Usage scenario: I want to take a bath and don’t want fan to come on automatically. Then, after the bath, I would either turn the fan on manually or simply want to re-enable the automation and let HA decide if the fan needs to run or not. Or, if I forget, the disable feature would reset after 60 mins and re-enable the automation for me.

Since this would take away one of the scene buttons, I’d like to see the following timer options: 15m,30m,45m,60m instead of the current 10,20,30,45,60

I looked at the YAML code and being a newbie at this it’s way above my head at the moment. I think I could change the timer values without breaking things but that’s about it. So I’m hoping for one of two outcomes by posting here. One, the usage scenario is viewed as actually pretty useful and the blueprint is updated to support it (or a separate blueprint is made building on this one). Two, someone can point me to the sections I would need to modify to do this myself.

I was also wondering if it wouldn’t be more efficient and failsafe to use the auto off device parameter (#16) instead of a software timer to set a max of 60m. I say ‘failsafe’ based on assumption I make that any HA failure (e.g. power failure, crash) or restart or zwave network congestion while the fan was on would mean the fan would stay on and have to be manually turned off.

Thanks for considering this.

Noob here. I’m going to use ZEN32 relay to control my fan too. Where did you insert the above code?

My guess is right above the last chunk (shown in screenshot below). Is that right?

Thanks for reporting this; I’ve pushed a proper fix for it tonight, and I also fixed two other edge cases that I found that were subtly broken. It’s possible they broke due to changes to Home Assistant events, but they are now handled properly :slight_smile:

Hey, my bad! I somehow didn’t get a notification in my inbox about this, and I don’t check this forum a lot, so I didn’t see this.

I’d like one of the small scene buttons, ideally bottom right, to be a “Disable FAN Automation” button (showing a red LED) that turns off the fan and disables automation for 60 mins then re-enables automation. I would also want to be able to override the “disable fan” feature if any button was pressed when it was ON, including pressing the “disable fan” button itself.

I understand the use-case, but I’m not really excited about implementing it. There are already a lot of ways that need to be tested, and I don’t really want to add more complexity here. I would suggest forking it.

I was also wondering if it wouldn’t be more efficient and failsafe to use the auto off device parameter (#16) instead of a software timer to set a max of 60m. I say ‘failsafe’ based on assumption I make that any HA failure (e.g. power failure, crash) or restart or zwave network congestion while the fan was on would mean the fan would stay on and have to be manually turned off.

This is actually a condition I’ve tested. Home Assistant records the end time in timers, so if it restarts, it should pick up with the right timer value!

I’m pretty sure that @germanm added an automation to deal with that bug. I’d suggest just starting with the current code though, as I’ve fixed two other edge cases like that as well now.

I’ve just installed my ZEN32 and found your blueprint to get it working very easily! Thank you so much!
I know custom timer presets is on the to do list, but would it also be possible to customize the LED colors? Are the smaller scene buttons able to do colors other than white?

I don’t believe I have a scene controller device. I’ve checked everywhere. I have a switch.

I know custom timer presets is on the to do list, but would it also be possible to customize the LED colors? Are the smaller scene buttons able to do colors other than white?

It supports other colors, so we could modify it. I’d happily take a PR to fix this!

This blueprint will only work if you have one of the scene controllers.

Hi sdwilsh,
It worked by manually adding my device ID instead of using the selector. I have the 800LR, and it looks like your selector is looking for the model ZEN32, but the 800LR shows the model of “ZEN32 800LR”.

1 Like

Ah, yeah, it filters here: https://github.com/sdwilsh/ha-zen32-exhaust-fan-blueprint/blob/003a5fc278a114994cd183dc0aa1ef1e6721203f/zen32_exhaust_fan.yaml#L19

If they are the same, maybe that can be opened up, but last I looked, the documentation on this syntax isn’t great, alas.

The 800 works perfectly using your blueprint. Adding the ID worked for me so no biggie.

Is there an easy way to change the times on the buttons or will that break things?

I’ve looked at editing the blueprint and, at 700+ lines of code, taking a stab at it when I’ve only been using HA for a few weeks doesn’t give me warm fuzzies. The WAF would be much higher if it could function more like the ones at our old house. The big button being 60 minutes (and off) is going to meet with resistance. :slight_smile:

Thanks!