Hi! I was wondering how I would go about configuring a blue series on/off to behave as a countdown timer? I have a heated towel rack that only has an on/off switch. What I’d like to do is wire a blue on/off series to it and have it start a timer when turned on and the LEDs reflect the state of time remaining. I’ve found some posts that seem to indicate this is possible but haven’t found any clear instructions on how to accomplish this. I see parameters for each individual LED in z2m but unsure how to put it all together.
I don’t think there’s anyway to do that just with the switch. What Home Automation system are using? There are a couple of ways I can think of to do that with Home Assistant (that’s what I use). If you’re using something else, then someone who uses one of those platforms could probably help.
AutoTimerOff
Automatically turns the switch off after this many seconds. When the switch is turned on a timer is started. When the timer expires, the switch is turned off. 0 = Auto off is disabled.
This is controlled within the switch itself. No hub necessary.
So with this setting, it would shutoff after the timeout is reached. Would I be able to have multiple timeouts, for example 4hr, 2hr, which would be set based on the number of button presses?
And going one step further, could I have the starting amount reflected by the number of LED segments, so 4hr would be all 7 lit up, but 2 hr would only light up the bottom 4 for instance?
I don’t believe the switch can do that on its own.
At that point your best bet is an automation in Home Assistant that takes the button presses from the scene controls and sets the leds you want lit up as well as maintains the timer. I’ve thought about putting one of those automations together myself for a while but haven’t done it yet. For me a single timer is generally enough.
There is a parameter that allows the LED bar to reflect the time remaining. But initially, the full bar is lit, and then moves down as it is getting closer to expiring. This isn’t exactly what you’re looking for, but it is similar.
P12 is the simple auto-off timer. P121 is the more advanced one.
Parameter 12 - Auto-Off Timer
To set an auto-off timer where you can have your Blue Series Fan Switch turn off after a certain amount of seconds, you would select Parameter 12 within your hub and then input a range of 0-32767, where each interval is a second.
Parameter 121 - Advanced Timer Mode
If you want to set a fan timer on your Blue Series On/Off Switch, then search for Parameter 121 and set it to a value of 1. When the fan timer is enabled, then a tap up 1x on the paddle turns the fan on, a tap up 2x sets a 5 minute timer, a tap up 3x sets a 10 minute timer, a tap up 4x sets a 15 minute timer, a tap up 5x sets a 30 minute timer and a tap down 1x turns the fan off and the timer is cancelled). The LED Bar will show how much time is left if this setting is enabled and running. By default this feature is set to a value of 0, which is off.
Both of the parameters I described are available on the VZM-30 On/Off switch. The link I posted is for the On/Off parameter table. You’ll see both parameters listed there.
I think that’s a parameter we missed for Zigbee2MQTT support (because I didn’t know that I was supported on the on/off switch). In fact, it’s also missing on the VZM31-SN in Zigbee2MQTT. We can get it added to both.
Yes, both are paddle activated. If you want to do something with the config button, then you’ll need to use an automation as opposed to relying upon the built-in timers.
Not in actual YAML (I don’t have any of the switches yet). And it seems like you want something more complicated than I was thinking. If you wanted just one timer count down, then you would write an automation that triggers when the switch turns on and then turns on all the LEDs. Then after a set time you would turn off one of the LEDs and keep doing that until you reached the end of the time you wanted.
The challenge is if you want the button to keep changing the timer amount, then you have to figure out how to stop the script that’s running and start again with the new value.
If I had a switch and some time to play in HA, I could probably give better advice.
You could do this in pieces and glue them together. Trigger an automation with the click combo and set an input datetime. Here’s part of my “Konami Code” automation that manages my up-up-down-down combos:
Then, another trigger when {{as_timestamp(now()) - as_timetamp(input_datetime.countdown) > (60 * 60 * 2) }}* (2hrs) to shut it off. You’d use similar triggers to “count down” the timer.
Set the individual LEDs with my blueprint. This code will set LEDs 1 – 6 to blue with LED 7 flashing yellow. You can either template the LEDcolor_on_custom or copy / paste it 7 times to generate the 7 stages of countdown. Turn off 7, flash 6; turn off 7 and 6, flash 5; etc…
Thank you very much for this detailed info. Once the switch arrives, I’ll see if I can piece things together. Looks like I have a lot of learning to do
I’ve also got a blueprint that’s used pretty commonly here for managing the button taps. Combining that with what @kevinschlichter provided should get you close.
It does sound promising. I have to learn some more about HA in general before I can say for sure. I appreciate the assistance. I am a software dev so hopefully that will help somewhat.