Dimmer setLevel() without Turning On

image

Dimmer level setting in device driver...

I want to implement the ability to set the level of a dimmer without turning it on. I know that not all dimmers allow this, but the device I'm working with does.

I'm not entirely clear if the setLevel() command is intended to be used in this way, because from what I've seen in Rule Machine, it would imply that dimmers are expected to be switched on/toggled when the command is called.

I can implement some logic using the duration parameter, perhaps passing in -1 to indicate that the dimmer should not be switched on, however I'm wondering if there is a standard way of achieving this.

Cheers

1 Like

Existing Hubitat device drivers that allow this do so via a user preference setting called something like “Enable Level Pre-staging” (or something like that.). Thus, it is a per device setting, rather than an overloaded API.

2 Likes

On the strength of that advice, I went looking for any mention of "Pre-Staging" under my (one and only) in-wall dimmer switch, but found no such entry. Perhaps Hubitat once gaveth but hath since taketh away?

Back on Vera (boo), I accomplished this task one of two ways: Either (a) use Lua code to set LoadLevelLast (the desired device parameter) directly, or (b) create a rule in Multi-System Reactor (MSR) which triggered every time the switch goes OFF, then set LoadLevelLast to my chosen level.

Although MSR does work with Hubitat, as many of you know, there is not (yet) parity among all the entity actions I once enjoyed with Vera, thus no ability to preset a particular variable on my Hubitat device. That I know of!?!

Has anyone else had success in this admittedly special area of endeavor?

Thanks in advance - Libra

P.S. As the OP pointed out, setLevel() is not the way to go here, since all that does is turn the switch back on at the indicated dim level. We're looking for a method by which to PRE-set that level, without the light coming on.

Probably not, though they actually have standardized this into a dedicated "capability" at the platform level now instead of a preference that alters the behavior of the normally-otherwise-standard setLevel() command. A "capability" is a way for device drivers on Hubitat to say, "Here are commands and/or attributes I support." Here, the new capability means that devices that support this will have a presetLevel() command--not a preference, and no longer something that alters the behavior of the standard setLevel() command, which caused confusion with some users and issues with some apps. You can still find many drivers with the "old" prestaging preference, and I'm not aware of it having been removed from anything that used to have it, just new drivers appearing that do things in the new way.

But regardless of how it's implemented, the device has to support it. Most Zigbee bulbs/dimmers do. I don't believe most Z-Wave devices do. (I'm not aware of any built-in driver that "fakes it" by internally storing a level and then using that next time--technically possible if Hubitat is the only thing that can ultimately control the device in question, but again not anything I'm aware of. And it would get messy for Z-Wave Association, Zigbee TouchLink/bound devices, or LAN devices, etc. if it isn't natively supported and is faked, so I can understand why.) So, not all devices will have it.

I'm not sure what specific device you are talking about; that might be good to know. Otherwise, it may be possible to do this at the app level instead, or possibly with a custom driver.

1 Like

I didn't wanna go too far into the weeds with specifics (since I've long assumed this was standard Z-Wave dimmer switch behavior), but I should declare:

  1. I'm new (as of today) to Hubitat - hello - after 11 years with Vera hubs;
  2. The switch in question is an Intermatic HA20C Z-Wave dimmer (3-way);
  3. I've tried using both the "Generic Z-Wave Dimmer" and "Generic Z-Wave; Smart Dimmer" frameworks for this device, hoping to elicit more granular control (but no changes there);
  4. I'm certain this LoadLevelLast feature is native to this switch, and was not a fancy bit of trickery by the Vera Plus hub to which it used to be paired;

I am convinced as well that most users don't really care what level their lights dim to when turned ON (normally 100%), but I do because certain bulbs behave better (or save energy) at particular levels or range of levels. TO wit, some LED bulbs don't enjoy being dimmed too low, and my eyes don't enjoy them being dimmed too high, and some houseguests play with our dimmers, so I use LoadLevelLast to calm things down between uses. :slight_smile: Nothing more sinister than (as is currently happening with Hubitat at the helm...) having your dining room light turn ON to only 10% because someone dimmed it manually to that level (before it went OFF last) while you weren't looking. LOL

Hope that explains my situation a bit more succinctly.

I didn't see the user manual with a quick search of the net. But if you can find that setting (parameter number) you can set this by using the Basic Zwave Tool. Super basic Z-Wave parameter tool

You basically download this code to your hub, change the device type (driver) to this tool temporarily, and from there you can read and set the hidden parameters. Once you get it set, you change back to the normal driver.

While I am eager to try your suggestion, I'm going to keep that one in my back pocket for the moment. Party because I don't want to come in guns-a-blazin' trying to fix what (to me) should be a rudimentary problem. And, secondly, because it is my belief that "parameters" tend to be reserved for things like indicators, associations, button behaviors, etc. -- that is, fundamental, highly device-specific, set-once-and-forget items, as opposed to "runtime" items like dimness levels that all devices of a particular class abide.

Still, nice suggestion, and I've added it to the long list of things I'd like to explore in Hubitat!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.