04.11.2025, 12:03
Here's a working example for HTML progress element.
HTML widget contents:
Custom JS, change widgetId and addr as needed:
Trends cannot be used to display on/off times for a binary object. Trends aggregate the data without storing changes as exact timestamps.
For this you need something like Graph widget from old visu that uses data from object logs.
HTML widget contents:
Code:
<progress max="100" class="w-100"></progress>Custom JS, change widgetId and addr as needed:
Code:
const widgetId = 123
const addr = '1/2/3'
let progress
function onChange(value) {
progress.value = value
}
Visu.on('widget-ready', widgetId, ({ widget }) => {
progress = widget.getEl().querySelector('progress')
localbus.listen('object', addr, onChange)
})
Visu.on('widget-hide', widgetId, () => {
localbus.unlisten('object', addr, onChange)
})Trends cannot be used to display on/off times for a binary object. Trends aggregate the data without storing changes as exact timestamps.
For this you need something like Graph widget from old visu that uses data from object logs.