zone/:zone/shuffle/:mode: mode can be 0 for non-shuffled, and 1 for Repeating one track, and 2 for repeating mutliple tracks. zone/:zone/repeat/:mode: mode can be 0 for non-repeated, 1 for Stepping (when using + or - from the UI) is controlled by the Loxone module. Parameters go from 0 to 100 (from mute to hightest possible volume). zone/:zone/volume/:volume: set the volume of the given zone. zone/:zone/time/:time: seek to the corresponding time. zone/:zone/play/:contentId: start playing on the given zone the provided zone/:zone/state: returns the state of the zone, as described in the upper All of them are POST, except the first one: Your server can receive the following HTTP calls regarding player (zone)Ĭontrol. PUT /:position: replaces one or more items starting from the givenĭELETE /:position/:length: removes the items stored in place starting You can know which items were added by checking their id. Items will be passed as part of the body of the HTTP call, in the shape ofĪ JSON array. Other words, the position passed is the one that the first new item will occupy. POST /:position: adds one or more items before the given position. Position in the position query parameter. GET /:position: returns the list of elements starting from the given Inįact, extra keys are ignored and do not constitute an issue. Return a track object within an item list and fulfill its requirements. Note how list and track interface naming are carefully picked, so that you can
Creating a server isĮasy in the majority of languages. You first need to point the plugin to your HTTP server. To enable you reading the actions thatĬome from the Loxone UI, please keep reading.
are for internal management andĬommunication with the Loxone Miniserver, and they have nothing to do with the
#LOXONE AUDIO SERVER CODE#
Through query string, with the following values:Īny other code will restart the service after 5 seconds.Īll of these ports ( 7090, 7091), etc. restart: useful for restarting the service. The server contains a variety ofĮndpoints (and a WebSocket) used by the Loxone Miniserver and the UI toĬommunicate with it. Is the default port used by Loxone Miniserver. Thus the first Music Server will run in port 7091, which The fake server runs in port 7090, and each Music Server created will run on aĬonsecutive port. They are developed in PHPĪnd made generic enough so that just by editing the configuration file Icons and webfrontend: contains the code used by the LoxBerry to show theĬonfiguration pages of the plugin under the web UI. Startup, and will bring the service to live. Service runs as a standalone server, and self restarts if something wrongĬonfig: configuration file, read and written from the PHP frontend and fromĭaemon: contains the initialization code that is run by the LoxBerry at The service is made in JavaScript (Node.js). The code is divided into the following folders:īin: where the service lives. HTTP calls (not all parts work the same way internally).Ĭode is architected following the conventions proposed by the LoxBerry project.
Managing the connection to the Miniserver and the Loxone UI, as well as theĬonverts the protocol used by the UI and the Loxone Miniserver into standard, You receive calls by creating an HTTP server that will have to respond to Server, this plugin proxies you calls about things that happen in the Loxone To enable plugin developers to create their own customizations with the music The actions that happen in the UI sent to a remote HTTP endpoint. This plugin emulates a music server into the LoxBerry, providing a way to get