To switch Volumio to a specific web radio you can use the /api/v1/replaceAndPlay endpoint, which allows you to replace the current queue with a specific item and start playback.
Here’s how you can achieve this:
1. Identify the Web Radio URL
You need the direct streaming URL of the web radio you want to play.
2. Use the /replaceAndPlay Endpoint
Send a POST request to Volumio’s REST API with the required payload.
Example Request:
If the Volumio device’s IP is 192.168.1.100:
Request:
POST http://192.168.1.100/api/v1/replaceAndPlay
Content-Type: application/json
{
"service": "webradio",
"type": "webradio",
"title": "My Favorite Radio",
"uri": "http://stream.example.com/radio"
}
3. Details of the Payload
service: Must be "webradio".
type: Indicates the type of media, set it to "webradio".
title: A descriptive name for the radio station (optional).
uri: The URL of the web radio stream.
4. Send the Request
You can send this POST request using tools like curl, Postman, or a script in Python or JavaScript.
If successful, Volumio will replace the current queue with the web radio stream and start playback. The response will typically contain a status message confirming the action.
Notes:
Ensure the streaming URL is valid and accessible by the Volumio device.
Some web radio URLs may require specific headers; check compatibility if playback fails.
Since payload is json formatted string, you can use any scheduling capable process to your liking.