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.

Access to tags field from Mosaic js
#1
Hi,

Is it possible to use grp.gettags(alias) directive in Mosaic custom widgets?

I've modified original "light-switch" widget with the following code, but it does not seem to work:

Code:
readTags : function(i) {
    var value = false;
    var o = "object-"+i;
    if(grp.gettags(o)) value = grp.gettags(o);  
    return value;
},

Then I insert this string in _.template section:

Code:
<%=readTags(i)%>

But I get an error 'TypeError: this.grp is undefined'.

The idea is to use tags from group addresses to display custom images on switch buttons instead of ON/OFF text, corresponding to the type of lamp its is associated with. Each room has different set of lamps, eg wall lamp, ceiling lamps, table lamp, down lights etc... If we could read tags associated with these lamps (group addresses)  - it will be possible to put corresponding images automaticaly.

Thanks for any help.
Reply
#2
grp functions are only available in main/touch visualizaion, but not in Mosaic
Reply


Forum Jump: