Logic Machine Forum
Visu Heartbeat - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Visu Heartbeat (/showthread.php?tid=3858)



Visu Heartbeat - sebastian.strasser - 07.02.2022

Hello,

i am not familiar with javascript.
is it possible to create in Javascript a Heartbeat on a GroupAdress?
The GroupAdress have to be based on the Username or anything else.

I have the Problem that sometimes the Visu is not showing on ipad in safari after many days(Display is Black, Guided Access). I want to create a error when the visu is not connected.

In the Project i have 50 Spacelynks with 4 Ipads per Spacelynk with a different Visu per iPad


RE: Visu Heartbeat - Erwin van der Zwart - 09.02.2022

I think something like this should work..

Add this to your custom JS and adjust the usename for each panel and the group address where you want to receive the live signal
Code:
$(function(){
  setInterval(
    function () {
    if(Globals.user == null){
        // Action when visu has a disabled logon
    } else if(Globals.user == "username panel 1"){
        grp.update('1/1/1', true)
    } else if(Globals.user == "username panel 2"){
        grp.update('1/1/2', true)
    } else if(Globals.user == "username panel 3"){
        grp.update('1/1/3', true)
    } else if(Globals.user == "username panel 4"){
        grp.update('1/1/4', true)
    }
    }, 60000); // Interval of live signal every minute
});
For monitoring in the controller you can add a resident script to 60 seconds, tag your live signal objects with the tag "Live Signal"
Code:
livesignals = grp.tag('Live Signal')
for key, object in pairs(livesignals) do
  difference = os.time() - object.updatetime
  if difference > 120 then
    log(object.name .. ' is offline')
  end
end