I’ve just added another Red Series Dimmer in my office wired to overhead LED can lights. In the morning I want to raise the dimmer from the minimum to maximum over 4 hours. I’ve got a flow in Node RED to do the math and send a message to set the level every minute. I was just wondering if, since the setLevel method on the driver has a duration, I can just do it with one call and convert the 4 hours into seconds and set it into the duration parameter to the setLevel() call?
I’ve never tried a value that large, but theoretically, I think that would almost work, except the maximum value the Z-Wave spec accepts for this appears to be 127 minutes, by my interpretation — so you’ll be capped at a bit over 2 hours. I suppose you could split this up into two and send the command twice, creating the 4-hour effect you want, via Node-RED or Rule Machine (which has a “fade dimmer over time” action that also simulates this), or just keep doing what you’re already doing.
Oh, I didn’t realize RM had a built-in function for that. That seems the simplest, so I’ll go with that. Thanks!
There is a difference that may or may not be an issue for you (it is for me ). The setLevel(level,duration) command that is built in to the switch will cancel if anyone manually taps the switch on or off. In other words, if I initiate a fade-to-off using setLevel(0,255), the light will slowly start dimming. And if I don’t want to wait 2 hours, I can tap the light off and the fading is done (canceled)
However, the RM fade sends multiple, independent setLevel commands over the duration. If it starts this fading and you tap the light off, the light will turn off until the next interval and then RM will send another setLevel(x) command which turns the light back on. This can be confusing and very detrimental to the WAF when she turns the light off and then it turns back on (repeatedly)
Of course, you can add more logic to the rules so that a button press on the switch will cancel a current fade in progress. Just be aware of the behavior and realize its not quite as simple as it first seems
That’s good to know. So what’s the max value I can put in for duration? I guess 4 hours isn’t a hard requirement. I just want it to be gradual.
The Inovelli driver appears to accept really large values without generating an error. However, I believe the firmware inside the dimmer is forcing it to comply with the z-wave specs, which Bert previously posted as being 127 minutes max (slightly over 2 hours). The Inovelli driver wants values in seconds so that would be 7620 seconds.
Hmm… Well, I tried that this morning and setLevel(99, 7620) just makes it happen immediately.
I just tried it and am seeing the same thing.
I did some experimenting and it looks like the max is actually 126 minutes, not 127. That, of course, would be 7560 seconds. It apparently accepts values up to 7589 because the driver divides by 60 and rounds off:
7589/60=126.4 rounded = 126
7590/60=125.5 rounded = 127
Thanks so much for digging into that!
A couple other things I noticed:
The internal clock does not appear to be highly accurate…especially with longer fades. In my testing, telling it to fade over 126 minutes actually took about 131 minutes. Its not an issue for me and I don’t really expect it to be a super accurate timer. Just be aware that setting it for 126 minutes could be off by several minutes in reality. Might be something you need to test/tweak if you’re trying to hit very close to a 2-hour duration. I haven’t tested it, but if you wanted to be really close to a 1-hour or 2-hour duration and adjusted the value to compensate for the internal clock error, I suspect it would be very consistent using that same ‘tweaked’ value every time.
The dimmer does not report power/energy usage while the fade is in progress. Its not something you would normally notice on short fades, but on long fades like this, its a little bit odd that the dimmer reports 0 watts the whole 2 hours its slowly fading up, even if you manually poll the device. Its only when the fade finally completes that it sends a valid power report.
09:40:21.187 am Entry light: Power report received with value of 10.0 W
09:40:20.525 am Entry light: Power report received with value of 0.0 W
09:40:18.728 am Entry light: Multilevel report received with value of (99)
07:28:33.638 am Entry light: setLevel(99, 7589)
07:28:09.511 am Entry light: Power report received with value of 0.0 W
I also noticed it’s not updating its level (at least to Hubitat) unless I do a refresh. Maybe these are things for Inovelli to take a look at?
Correct. It does not automatically send periodic level reports while the fade is active. But a Refresh or Poll will report the current level at that point in time. However, the power report doesn’t change during the fade even with a forced Refresh or Poll
It depends on what/why/how you expect the level changes to be reported? Normally, fades happen over seconds not minutes. It would not be good for the Zwave mesh if every fade sent a level report for every step of the fade. It makes sense to me that no reports are automatically sent during the fade and it only sends a single report at the end of the fade. The only part I thought was weird is that manual polling did return the current level value but not the current power value. (i.e. the light was ‘on’ for over 2 hours but reporting 0 watts the whole time until after the fade completed 2 +hours later)