Automatic Change web radio stream depending on week day

Hello,

I am running Volumio on a RPI. we use is in a factory to stream web radio.

To keep every worker in the factory happy we use every day another Web radio stream.

Is there a way to switch tis automatic.

for instance.
monday webradio 1
tuesday am webradio 2 pm webradio3
etc etc.

Hey @dfgnodde,

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.

Example with curl:

curl -X POST http://192.168.1.100/api/v1/replaceAndPlay \
-H "Content-Type: application/json" \
-d '{
  "service": "webradio",
  "type": "webradio",
  "title": "My Favorite Radio",
  "uri": "http://stream.example.com/radio"
}'

5. Expected Response

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.

All documented here:

Kind Regards,