Max2Play Home › Forums › Max2Play as Squeezebox (Player / Server) › How to avoid that jivelite pops every minutes when I want to quit it
- This topic has 3 replies, 2 voices, and was last updated 1 year, 10 months ago by MarioM Moderator.
-
14. Oktober 2022 at 22:48 #52436
Hello,
I’m using Max2play on a raspberry pi 7″ touch screen with jive lite and a openhab dashboard for specific controls.
When I want to access my openhab dashboard, I have to Quit jivelite. Then I’m on the desktop and can start chromium to load my openhab dashboard.
When I’m using it, every minutes on „00“ seconds (smells like a cron) the jivelite screen popus up and hide my page.
Sometime it’s usefull when I want to go back to jivelite.
But more often it occures at the wrong moment 🙁How can I disable that behaviour of Jivelite ?
I’ve add a button on my dashboard to send a api command : http://maPlayer/plugins/jivelite/controller/Setup.php?action=start
side-question : How could I call api-command from openhab dashboard with URL buttons if I want to ignore the returneds http content ? At this moment I open a new tab and close it after, but it’s not very clean. Do you have suggestions ?
When I sent a http://maPlayer/plugins/jivelite/controller/Setup.php?action=stop the GUI Stops and I’m back to the shell prompt login screen which is not what I want 😉
18. Oktober 2022 at 13:04 #52438Hi Jack,
I’m glad to hear that your openHAB setup is working. To prevent Jivelite from opening automatically, you can simply deactivate the autostart of the Jivelite in the Max2Play webinterface.
The browser always opens links in a new tab or window. With command line tools like curl or wget you could call the links without opening a new tab. But I’m not sure if you can use them with openHAB.
16. Dezember 2022 at 1:06 #52531Hi 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 year, 10 months ago by Jack Bauer.
- This reply was modified 1 year, 10 months ago by Jack Bauer.
- This reply was modified 1 year, 10 months ago by Jack Bauer.
-
You must be logged in to reply to this topic.