10.02.2026, 09:07
Hello, I have a question.
I have a custom thermostat widget, and using this code I can change its color depending on the state (heating/cooling). However, I use the same custom widget for different thermostats and replace the group addresses.
The problem is that the other thermostat depends on a different state address of (heating/cooling), and I’m not sure how to handle this properly with the same widget.
Do you have any solution or suggestion for this?
I have a custom thermostat widget, and using this code I can change its color depending on the state (heating/cooling). However, I use the same custom widget for different thermostats and replace the group addresses.
The problem is that the other thermostat depends on a different state address of (heating/cooling), and I’m not sure how to handle this properly with the same widget.
Do you have any solution or suggestion for this?
Code:
Visu.on('widget-ready', 894, ({ widget }) =>
{ const el = widget.getEl()
if (el) { const fg = el.querySelector('.circularslider-fg')
widget.listen('1/4/8', (value) =>
{ fg.style.setProperty('--visu-widget-active-color', value ? 'rgb(255, 0, 0)' : 'rgb(0, 0, 255)') }) } })