Hello HmiGuide, the attributes are obtained via the callback function when I subscribe to an item: (function() {
var actions = shmi.pkg("visuals.session.userActions"); //get reference to userActions object
/**
* UI-Action 'get-item-attributes' implementation
*
* @params {any[]} parameters configured ui-action parameters
*
*/
actions["get-item-attributes"] = function(parameters) {
//Place your code here
const item = parameters[0];
if (item) {
const im = shmi.visuals.session.ItemManager,
tok = im.subscribe([item], (name, value, type) => {
console.log(`New value for item '${name}': ${value}`);
}, (name, properties) => {
if (properties.initialized) {
shmi.notify(JSON.stringify(properties, null, 4));
tok.unlisten(); //... when subsription is no longer needed, unsubscribe:
clearTimeout(timeout);
}
console.log(`Properties changed for item '${name}': ${JSON.stringify(properties, null, 4)}`);
}),
timeout = setTimeout(() => {
tok.unlisten();
shmi.notify(`TIMEOUT ERROR: Item ${item} does not respond!`)
}, 1000);
}
};
}()); I have attached a small WebIQ HMI project to try out. Hope that helps? Many greetings webiq eg
... View more