This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

HTML Widget
#2
At the moment you can use this code. Modify widgetId, address and query selector as needed. Later on we'll add a more convenient way of listening to group address changes for a particular widget.

Code:
const widgetId = 28
const address = '0/0/21'
const values = {}
let widgetEl

function updateWidget() {
  if (widgetEl) {
    widgetEl.querySelector('.value').textContent = values[address]
  }  
}

localbus.listen('object', address, (value) => {
  values[address] = value
  updateWidget()
})

Visu.on('widget-ready', widgetId, ({ widget }) => {
  widgetEl = widget.getEl()
  updateWidget()
})

Visu.on('widget-hide', widgetId, () => widgetEl = null)
Reply


Messages In This Thread
HTML Widget - by Fahd - 15.01.2026, 14:59
RE: HTML Widget - by admin - 20.01.2026, 11:08

Forum Jump: