Code: Select all
return {
on = {
devices = { 'Radio' },
timer = { 'every 5 minutes' },
},
execute = function(domoticz, device)
if domoticz.devices('Radio').state == 'Off' then
os.execute ("ssh [email protected] killall mplayer")
os.execute ("ssh [email protected] mplayer -noconsolecontrols /home/pi/domoticz/testsound.mp3 -volume 100 &> /dev/null")
end
if device.state ~= 'Off' then
if device.state == 'Radio 1' then
os.execute ("ssh [email protected] killall mplayer")
os.execute ("ssh [email protected] mplayer -noconsolecontrols http://icecast.vrtcdn.be/radio1-high.mp3 -volume 100 &> /dev/null")
end
if device.state == 'Studio Brussel' then
os.execute ("ssh [email protected] killall mplayer")
os.execute ("ssh [email protected] mplayer -noconsolecontrolshttp://icecast.vrtcdn.be/stubru-high.mp3 -volume 100 &> /dev/null")
end
end
end
}