Virtual Dimmer; startLevelChange not implemented?

trying to invoke level change only to receive IllegalArgumentException in the logs.

What gives?

The command is not implemented, but neither is the capability declared, so no app should expect it to be there. (It is distinct, and not all devices that have dimming capabilities implement the command.) Assuming you aren’t just curious: what are you doing, where are you seeing this, and is there a problem you were trying to solve?

1 Like

given it's virtual device e.g. used for testing all aspects of dimmers i assumed its reasonable to expect all capabilities declared / implemented.

trying to use IKEA RODRET dimmer button to change the level of a dimmer
I have 3 virtual dimmers that are tied to one physical RGB driver,
each dimmer for separate color,
hence controlling intensity of 3 separate led strips

The capability for a dimmer is "SwitchLevel," and it requires the setLevel() command with the level attribute. See:

Typically, dimmers also have switch functionality, so "Switch" is typically also implemented (on() and off() commands plus the switch attribute showing the on/off state).

Anything beyond that tends to vary by device: power metering, button/centralscene events, start/stop level change for smooth dimming, etc. I don't think not having this command is unusual. Not all "real" devices support it, either.

What would you want startLevelChange() to do if implemented? Since there is no real load to control, there is no device to respond and send back a new level when you stop, among other complications. Virtual drivers tend to respond only to commands, e.g., setLevel() and change related attributes only when commanded, though there are certainly ways to "simulate" behavior automatically if needed.

That being said...

Have you looked into the Mirror app? It sounds like it might be able to do what you want for you without the need for virtual devices of your own creation.

If you do want a virtual device that does exactly what you want, writing a custom driver might be the best approach. Virtual devices are generally very easy to write, and you can likely find a starting point for a dimmer with a search in the community if needed (but you'll still need to think about what you want these commands to do).

Interesting point with the Mirror app, i do try to mirror an aspect, but number (level) needs to be mapped to RGB component ( HEX string ) ...

seems the route of least resistance would be to hack away at mirror app source and implement all the above and the need to somehow have switches with "detached" rocker (dumb switch)

Mirror is not open-source, so that seems to like the path of most resistance to me. :slight_smile:

Hubitat works natively with hue/saturation/value for its color model (the latter is called "level," but the color model is HSV/HSB, not HSL). Is there any way you can just work with the HSV values instead of RGB? That seems like the easiest path to me.

If not, conversion is easy (most easily in custom Groovy code, though you could probably look up the algorithm and do something with a few local variables in a Rule yourself if you don't want to).