Logic Machine Forum
Change page at condition on event script - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Change page at condition on event script (/showthread.php?tid=2765)



Change page at condition on event script - Frank68 - 31.07.2020

Hi

I have see th epobbility to change the page by custom script

Code:
$(function(){
  if (typeof objectStore !== 'undefined') {
    var id = Scada.encodeGroupAddress('32/1/41');

    objectStore.addListener(id, function(object, type) {
      if (type == 'value') {
        showPlan(55);
      }
    });
  }
});
But if i Need to cahneg page not for all change of 32/1/41 but only if increase is a number , is possible directly custo script or need make a event script , if I use event script , in wich way change page for ES.

BR,


RE: Change page at condition on event script - Erwin van der Zwart - 31.07.2020

Hi,

Change showPlan(55) to showPlan(object.value) to select a plan based on the KNX value, then you can put the logic in the controller.

BR,

Erwin


RE: Change page at condition on event script - Frank68 - 31.07.2020

Hi

OK this if I want to pass the page number to go to, I would be interested since the object is a numerical value so that the change takes place only if the value increases, and not if it decreases but the page is the same. Is it possible to do it in the controller or do I have to lean on a virtual object?

BR,