Reply To: How to avoid that jivelite pops every minutes when I want to quit it

Max2Play Home 2016 (en) Forums Max2Play as Squeezebox (Player / Server) How to avoid that jivelite pops every minutes when I want to quit it Reply To: How to avoid that jivelite pops every minutes when I want to quit it

16. Dezember 2022 at 1:06 #52531

Hi Mario,

Thank you once more for your help!

Taking a lot of time to assemble the corrects parts, here is my openHab3 ECMA function I use to call URL if it can help some of us.


var logger = Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' + ctx.ruleUID);

var url = itemRegistry.getItem('http_get_command').state + "";

if(!!url){

  var HTTP = Java.type("org.openhab.core.model.script.actions.HTTP");
  var headers = [];

  if(url.startsWith("http://kitchen")){
    headers["Authorization"] = "Basic dXNlcjpwYXNzd29yZA==";
    logger.info("adding headers for kitchen");
  }else if (url.startsWith("http://room2
    headers["Authorization"] = "Basic dXNlcjpwYXNzd29yZA==";
    logger.info("adding headers for room2");
  }

  var result = HTTP.sendHttpGetRequest(url, headers, 15*1000);

  if(result == null){
    logger.info("result: ERROR");
  } else {
    logger.info("result: OK");
  }

} else{
  logger.warn("Ooops url is empty");
}

This function is used as a trigger of a String value model nammed „http_get_command“.

The habPannel button panel send commands to this model value. The command contains the full URL.

As my players are password protected, you’ll need to adapt this with your user:password encoded in base 64. You can compute it in a terminal


echo -n user:password | base64

this example should output „dXNlcjpwYXNzd29yZA==“

Make the same with your real user:password and replace „dXNlcjpwYXNzd29yZA==“ in the code with it for each player.

I know it’s not really safe to stock this as clear text password in a script file…

I hope it’ll help.

  • This reply was modified 1 month, 1 week ago by  Jack Bauer.
  • This reply was modified 1 month, 1 week ago by  Jack Bauer.
  • This reply was modified 1 month, 1 week ago by  Jack Bauer.