I would like to share with the community what I did to listen to my favourite radios via Domoticz...
Today, most radio stations can be "received" from the Internet via a live audio stream.
Here's what I did to receive these streams in my Domoticz ecosystem (Raspberry Pi 2B) :
1. Install MPLAYER : In a console window, enter:
Code: Select all
sudo apt-get update
sudo apt-get install mplayer
Code: Select all
#!/bin/bash
# echo RTL2
wget "http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=161&switchcmd=On" > /dev/null
sudo killall mplayer
mplayer -noconsolecontrols http://streaming.radio.rtl2.fr:80/rtl2-1-44-96 &
Second line will stop any running instance of mplayer. This is necessary to zap between stations.
Third line will activate the audio stream. Make sure you don't forget the & to launch the player in background. For each radio, edit the script and put the right URL. (Here's a list of URLs for French radios: https://doc.ubuntu-fr.org/liste_radio_france )
4. Create a script to stop listening:
Code: Select all
#!/bin/bash
wget "http://127.0.0.1:8080/json.htm?type=command¶m=switchlight&idx=161&switchcmd=Off" > /dev/null &
sudo killall mplayer > /dev/null &
Assign the scripts created at step 3 to each level, and the "stop" script (step 4) to the "Off" level
6. Here you go ... Enjoy!
Oliviers