Struggling to make a simple Play app.js using API

Hi @Ludovic_Boyer,

As far as I know, you should not put your calls inside core_paired.
This is called constantly, and used mainly to update the zone list.

What I did was I created an http api. Then you can create your app using any language you like and have them call your apis.

–bastian

Hi @St0g1e,

Thanks for your answer. I know that I should not use calls inside core_paired. I did this because of my serious lack of knowledge of Java language.

I used a trick to use run a play/pause only once inside core_paired in post 20.

However, although it works great when I run the app.js directly from the Terminal, it doesn’t work at all if try to run the app.js from OpenHab, as I have to validate the API in Roon each time OpenHab runs the app.js.

I will try your and @Matthew_Clegg’s suggestion to use an http API.

Cheers,

Ludovic

Hi,

I tried using an http API by following the instructions given in Control Roon from the iOS Notification Center as a widget, and it works much better than what I did.

I can safely say now that my solution is wrong, or at most, not optimum.

Cheers,

Ludovic

1 Like

Hi @Ludovic_Boyer,

I have uploaded my APIs that can be called by http at:

I have created several webpages that calls these apis (player, browser, and timer).
I have created a swift project for iPhone using these APIs as well as created widget using the iOS’ workflow app.

Please note that the webpages are just test pages to make sure the API calls are working. I have not created a good looking page or have error checking.

Hopefully it’ll help you creating your app.

–bastian

3 Likes

Hi @St0g1e,

Many thanks for sharing!

I followed the instructions from your Readme file and the trials I made using your test webpages impressed me!

I will try to have a closer look to adapt it to OpenHab when I will have time.

Thanks again,

Ludovic

Hi @Ludovic_Boyer,

Cool…
Let me know if you have any questions.
By the way I have updated the repository to remove the get_image hack.

Bastian