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.

sound on Win/PC and Android/Tablet
#19
(23.12.2020, 06:54)admin Wrote: You are missing a closing } for the CreateListeners function. It should be like this:
Code:
// Function to create event listeners
  function CreateListeners(groupaddr,url){
    // Make event listener to object
    if (typeof grp != 'undefined') {
      grp.listen(groupaddr, function(object, state) {
        var value = object.value;
        var enabled = grp.getvalue('32/2/1');
        if (state == 'value' && value == 1 && enabled) {
          Play_Audio(url);
        }
      }, true);
    }
  } // missing closing "}"
   
  // Start creating listeners
  for (var i in AudioTable) {
    CreateListeners(AudioTable[i].address,AudioTable[i].url);
  }

Next time if Custom JS is not working check browser console (F12) for any error messages.


ok, thank you. Now it's working!

Another request, be patient    Angel : I would repeat the play of the beep until the condition change. I tried with a while - do loop, but it seems I make something wrong....
Reply


Messages In This Thread
RE: sound on Win/PC and Android/Tablet - by gdimaria - 24.12.2020, 08:04

Forum Jump: