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.

Overload existing Widget
#1
1/ Is there a way to add infos on existing value choice:

   

Like object name, and maybe object value from the original value with name difference like I did for the temp color change:

$(function() {
  $('.backTemp').each(function(_, el) {
    var addr = $(el).data('object');
    if (addr) {
      grp.listen(addr, function(obj) {
        var value = obj.value
          , color = 'rgba(255, 65, 65, 0.5)'; // default color
        //console.log(obj);
        //console.log(obj.value);
       
        var nom = obj.name;
        var newNom = nom.replace('SET','CUR');
        var valeur = grp.getvalue(newNom);

        if (valeur > 22.0) {
          color = 'rgba(255, 0, 0, 0.5)';
        }
        else if (valeur >= 18.0) {
          color = 'rgba(250, 165, 0, 0.7)';
        }
else if (valeur < 18.0) {
          color = 'rgba(75, 180, 230, 0.5)';
        }

        $(el).css('background-color', color);
      });
    }
  });
});


2/ Other option
I would like to generate a dynamic widget on ambiant temperature object clic, wich display setpoint choice, setpoint feedback, heat status, name of the room from object.namme or object.comment, background....

When you have 200 widget to do it would be great to overload your existing buton, or to dynamic create one (of course group adress should be with same name like room-set, room-ambiant, room-value, room-heat-state ...).



3/Last option but more pain, creat a script that generate all widget once...

Would appreciate if the first and second option is possible

4/ Last question when using cicle buton value choice (for setpoint temp for example). The arrow put value to min or max value, is there a way to only increase/decreas by step instead (like +1/ -1)
-----------
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT
Reply


Messages In This Thread
Overload existing Widget - by domotiqa - 05.11.2021, 13:38
RE: Overload existing Widget - by admin - 05.11.2021, 14:47
RE: Overload existing Widget - by domotiqa - 08.11.2021, 11:11

Forum Jump: