mjesun / loxberry-music-server-interface

MIT License
4 stars 2 forks source link

LoxBerry Plugin - Music Server Interface

This plugin emulates one music server into the LoxBerry, providing a way to get the actions that happen in the UI back into the Loxone Miniserver.

Motivation

There are multiple solutions out there to create your own music server, generally using a Logitech Media Server (LMS) and Squeezelite - which is a setup that copies the original Loxone Music Server. However, when visualizing the data coming from it, the recommendation is to feed the data back to the UI via virutal outputs, and emulate the UI. While this is a great overcoming of the limitations, being able to use the native UI exposed by Loxone seems to be the best. This plugin thus enables Loxone to use their specific UI for music presentation into their applications.

Code structure

Code is architected following the conventions proposed by the LoxBerry project. The code is divided into the following folders:

Service endpoints

The server runs in port 6090, and each Music Server created will run on a consecutive port. This means that your first Music Server will run in port 6091. The server contains a variety of endpoints (and a WebSocket) used by the Loxone Miniserver and the UI to communicate with it. Other endpoints worth noting are:

Communication

Music Servers expect to get and receive data via UDP, through the same address specified for TCP and Loxone Miniserver communication (i.e. in the case of the first Music Server, that will be 6091). This data is key to get actions executed in the interface and to push data back to it.

Data sent to Loxone Miniserver

All data is sent in the form of <ID>::<COMMAND>::<ARGS> (where <ARGS> are also :: separated). <ID> references the player executing the action, <COMMAND> references the action performend, and <ARGS> will contain attributes related to the command (if any). The following commands are supported:

Data expected to be received by the Music Server

Prior art

This plugin is based on the following elements: