Gauge widget dynamic dashboard - Value Range colors

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
Domoberry
Posts: 132
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Gauge widget dynamic dashboard - Value Range colors

Post by Domoberry »

I would appreciate a suggestion on below (and also accept "this use case is not intended" as reply as well :D )
I'm using the Gauge widget to display the state of an Alert Sensor.
The Alert Sensor is updated by a homebrew script, which takes data from a dynamic energy provider (Tibber) and shows a relative indication on the actual electricity price. e.g. 'error, very cheap/cheap, normal, expensive, very expensive'.
Objective: the Gauge widget to show the Alert Sensor state given its 'Alert level' (0 - 4) and 'Alert text'. The Alert Text contains the Alert Level and the actual electricity price. The arc color to represent the level (green / yellow / orange/ red etc.).
Hence, I created a Gauge widget and linked it to the Alert Sensor. The Gauge widget shows the Alert Text as expected. yet the arc is always greenish.
However, I do not seem to be able to set the widget's Value Range colors such that it corresponds with the Alert.
I tried various widget setting but obviously not the right one.
While trying, I noticed that the Gauge widget seems to parse 'Value Text' and take the starting 'number' in the text string as value. Purely by coincidence I was repeating the Alert Level as text in the Alert Text). The Gauge widget does not seem to interpret the 'Alert Level' number.
How to set the Value Range color ranges for this case?
Picture shows example of the current state
Screenshot 2026-06-16 231914.png
Screenshot 2026-06-16 231914.png (11.71 KiB) Viewed 605 times
Screenshot 2026-06-16 231951.png
Screenshot 2026-06-16 231951.png (11.05 KiB) Viewed 605 times
User avatar
gizmocuz
Posts: 3072
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Gauge widget dynamic dashboard - Value Range colors

Post by gizmocuz »

Thanks for reporting, best to do this in the dynamic dashboard topic so we have everything in one place.

Never thought someone would like to use an Alert Sensor in a Gauge widget... but yes that should also be possible :D

This is now fixed in the development branch and beta version (18030).

The Gauge widget now uses the Alert Level (0–4) field itself rather than parsing the text.
On top of that, when you assign an Alert sensor to a fresh Gauge widget it now auto-configures the scale to Min 0 / Max 4 and pre-fills the Value Range colors with the standard alert palette:

- 0 (undefined) → grey
- 1 (normal) → green
- 2 (warning) → amber/yellow
- 3 (alert) → orange
- 4 (alarm) → red

So a newly added gauge should "just work" with your alert sensor. For an existing gauge you already created, either re-add it, or manually set Min = 0, Max = 4 and configure the Value Ranges (e.g. 0–0 grey, 1–1 green, 2–2 amber, 3–3 orange, 4–4 red , each as a single-value range).

The first matching range wins, so single-value ranges map each level to its own color.

Here it does not seem to display the text (sValue) but in your screenshot above I see it is visible.
Quality outlives Quantity!
User avatar
Domoberry
Posts: 132
Joined: Tuesday 30 May 2017 19:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.2
Contact:

Re: Gauge widget dynamic dashboard - Value Range colors

Post by Domoberry »

Hi Gizmocuz, Thanks a lot for warp-speed solution!

I assumed incorrect usage on my side, hence posting this in a separate thread. Feel free to move this thread.

With the new Beta, the Gauge Widget works as I expected when representing an Alert Sensor.

This is the current result:
Screenshot 2026-06-18 104433.png
Screenshot 2026-06-18 104433.png (12.05 KiB) Viewed 521 times
Screenshot 2026-06-18 104453.png
Screenshot 2026-06-18 104453.png (8.13 KiB) Viewed 521 times
Some context: The Alert Sensor is updated by a dzVents script based on the 3-day moving average of the elektricity price. It turned out that Tibber offers this relative price level via their API. In my home automation, it is used to activate (or temporary suspend) certain appliances based on the current relative electricity price.
Post Reply