Hue and Saturation Ranges

Maybe this is obvious, so forgive me if I've missed some documentation or something otherwise obvious, but why do Device options have a Hue and Saturation range of 0 to 100, but Rule Machine has a range of 0 to 360?

Devices
image

Rule Machine
image

1 Like

This is because some devices support an option that will be labeled something like "Enable hue in degrees (0-360)" or "Enable high resolution hue":

What this does is allow you to use the 0-360 color model instead of the Hubitat (and SmartThings) convention of 0-100. The conversion in all drivers I'm familiar with is linear, and this setting just allows you possibly use "in between" values for more specific colors or smoother transitions (if you do something like increment/decrement the hue) if you so desire. This is not an option on all devices.

Rule Machine--or really any app--doesn't have a way to know if the specific device you're working with this either supports this option or has it enabled, so it lets you put in 0-360 as the result of a recent-ish feature request to make it work with devices where this option is enabled. Other apps will differ in their behavior here (and most with "pre-configured" colors like "blue" or "yellow" like in Simple Automation Rules will not work well with this option enabled--they'll probably use a 0-100 value and you'll have to use a manually specified 0-360 value to get the desired outcome). The device page for any of these devices should let you use the values if the driver supports it, regardless of what the tooltip text may say (which comes from the "standard" definition of this command), but I suppose an individual driver could still have a problem here, so if you notice one despite all of this, I'd mention something.

Also, Rule Machine shouldn't have 0-360 as options for saturation (unless they re-used code from hue inputs and this is just an artifact of that); no stock drivers I'm familiar with have a "high resolution saturation" option (nor does the standard model for saturation in the real world use these values--there is a conflict between Hubitat and real-world convention for hue, probably another reason that option exists). But I suppose any driver could, again, technically implement whatever options it wants here.

1 Like

I forgot to follow back up. Thanks for the input. That makes sense. And you're right, RM has 0-100 for Saturation.

1 Like