Skip to main content

Add your own user interface

BetaThe plugin SDK and these pages are new. They change with each release, as developers use them and tell us what works.View as Markdown

Ship a complete web user interface in your plugin, and let users pick it in place of the one that ships with Volumio. The interface is a folder of web files inside your plugin. The plugin registers it when it starts.

Prerequisites​

  • A plugin of type user_interface.
  • A built web interface: a folder with an index.html and the files it loads.
  • A way for users to switch back. Your interface must let the user choose another interface, as Volumio's own settings do.

1. Put the interface in the plugin​

Put the built interface in a folder of your plugin, such as ui/. On the device, the plugin lives in /data/plugins/user_interface/<id>/, so the folder is /data/plugins/user_interface/<id>/ui.

2. Register it when the plugin starts​

In onStart, call registerThirdPartyUI:

index.js
onStart() {
this.commandRouter.registerThirdPartyUI({
uiPrettyName: 'Now Playing',
uiName: 'now-playing',
uiPath: path.join(__dirname, 'ui'),
});
return libQ.resolve();
}

Every field is required:

FieldValue
uiPrettyNameThe name users see when they pick an interface
uiNameA short name in lowercase, without spaces
uiPathThe absolute path of the interface's folder on the device

Volumio checks that uiPath exists before it adds the interface. Each registration is saved in /data/thirdPartyUisList.json. An interface whose folder is gone, such as after the plugin is uninstalled, no longer appears in the list.

Check that it works​

  1. Install the plugin with npx --package=@volumio/plugin-sdk volumio-plugin deploy 192.168.1.20 ..
  2. In the device log, find Registering Third Party UI followed by your fields.
  3. In the Volumio settings, open the Appearance page. Your interface is among the ones users can pick.

If the interface does not appear​

Log lineCauseFix
Failed to register UI: <path> does not existuiPath points to a folder that is not on the deviceBuild the interface into the plugin folder, and pass its absolute path
Failed to register UI: missing uiName, uiPath or uiPrettyNameA field is missing or emptyPass all three fields

Was this page helpful?