Color Range Helper

logo

openHAB 4 blockLibrary to create colorRanges

Blocks

HSL to RGB

You can create any color by defining the HSL (Hue, Saturation, Lightness) values for it. See also the related wikipedia article for some description.

RGB ColorTemp

The three RGB ColorTemp helpers are made to convert a user supplied value into some color from a color-spectrum of two values. Usually this spectrum is ranging from red (HSL[0, 100%, 50%]) to blue (HSL[250,100%, 50%]), from warm to cold.

The three different helpers are really similar. The first one only receives the percentage of the maximum hue value (250 for blue). Based on this supplied value you will get some color between red and blue.

The second helper lets you define the minimum and maximum values of the value you are going to supply. These ranges can also be negative, therefore you can for instance give -5 as minimum, 30 as maximum for your usual temperature display.

With the last helper you can additionally define the ending colors of the spectrum you are going to use. This way you can use blue to red for temperatures, but also green to red for network speeds and the like.

Changelog

Version 0.2

  • late release of old changes
  • changed logging level from “log” to “debug”
  • fixed some links

Version 0.1

  • initial release

Resources

colorrangetools.yaml

Hi @rene_rostock I have checked and I have the latest version installed with “console.debug”. However I have these messages in openhab log:

2026-04-11 21:14:00.991 [INFO ] [.script.ui.nspanel_updateScreensaver] - HSL[150 92 47] → #0aeb7d
2026-04-11 21:14:01.033 [INFO ] [.script.ui.nspanel_updateScreensaver] - HSL[171 91 47] → #0be8c8
2026-04-11 21:14:01.076 [INFO ] [.script.ui.nspanel_updateScreensaver] - HSL[157 91 47] → #0aea97

It’s not DEBUG ?

Thank you for your help

Hi @lamazze , that’s strange. Maybe you can open the blockly editor and check on the bottom, there you can display the generated code.

It might be really long, if you are using icon transformations, but you might find the line with console.debug there. Or console.info, maybe.

Have you tried to remove the HSL converter and add it again? No idea how to update this otherwise…

Regards, Rene

I couldn’t find the “right” way to update the librairies so I’ve edited directly the 6 blocky librairies one by one in Development –> Blocky Libraries.

And following your comment in Parameters → Scripts, I’ve opened all my nspanel_xxx scripts and when you do that, you have a popup saying your script has been saved using an old script and that you should save it. Which I did.

Now however I see these messages in the log:

2026-04-12 10:11:01.089 [INFO ] [.script.ui.nspanel_updateScreensaver] - HSL[157 91 47] -> #0aea97
2026-04-12 10:11:41.831 [WARN ] [ity.CommunityMarketplaceAddonService] - Unable to retrieve marketplace add-ons: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 21120 path $.topic_list.topics[1].tags[0]
2026-04-12 10:12:03.089 [ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule ‘nspanel_updateScreensaver' with status 'INITIALIZING'
2026-04-12 10:16:22.646 [ERROR] [.script.ui.nspanel_updateScreensaver] - missing context for loading 'absorb_it_nspanel_weatherupdate' in 'nspanel_updateScreensaver', try 'NSPanel Item' from Helpers library!
2026-04-12 10:16:22.651 [ERROR] [.script.ui.nspanel_updateScreensaver] - missing context for loading 'absorb_it_nspanel_status' in 'nspanel_updateScreensaver', try 'NSPanel Item' from Helpers library!

Ignore my comment, I guess I tried to run it directly.

I had to open also my callback script and save it back.
–> no more HSL message in the logs

I still wonder what the message about marketplace means ?

Hi @lamazze ,

It’s definitely related to openhab itself and not to the add-on. Depends in the openhab version you are running, but maybe [marketplace] Unable to retrieve marketplace add-ons · Issue #5373 · openhab/openhab-core · GitHub

best regards, Rene

It means that you’re running a version of OH that supports “the old forum”. The forum was upgraded, which changed the format of what the forum exports so that OH had to be adapted to the new format. I made a fix, but I think it was only backported to 5.1.3 and 4.3.10, despite me trying to suggest otherwise. So if you’re running 5.0.x or a previous 3.x or 4.x version, the community marketplace is permanently dead.

thank you for your input. I guess I’ll upgrade Openhab.