View Single Post
Posts: 1,370 | Thanked: 1,897 times | Joined on Apr 2010 @ St. Helens, England
#10
Update on my internet radio alarm clock.
Bit long winded, hope this helps.

I have added a few extra command executions thanks to "berlinermaxe's" idea.

The following is all the commands to create an internet radio alarm clock that increases volume over time.
-

Firstly set the volume of the device to a nice level.
This ensures the radio will start at the correct volume every day.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days.
Set the 'time' to one minute before the radio alarm is to start.
Select a name for the alarm 'Volume Set 55'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:55
-

Then we need to start the media player, as mentioned before "http://streaming.gmgradio.com/rockradiomanchester.m3u" can be replaced with your choice.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days
Select the 'time' to start the radio alarm
Select a name for the alarm 'Radio Alarm'

Enter the following command:-

Code:
dbus-send --print-reply --dest=com.nokia.mediaplayer /com/nokia/mediaplayer com.nokia.mediaplayer.mime_open string:http://streaming.gmgradio.com/rockradiomanchester.m3u > /dev/null
-

Then to increase the volume, so I have set this command 5 minutes after the radio start time.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days
Select the 'time' to increase the volume
Select a name for the alarm 'Set Volume 65'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:65
-

Then to increase the volume again, so I have set this command 10 minutes after the radio start time.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days
Select the 'time' to increase the volume again
Select a name for the alarm 'Set Volume 75'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:75
-

Okay so now the radio starts and slowly you are awakening.
I now have a command to stop the radio, a command to start the alarm clock and then a command to put the volume back to full.
This then means I don't have to manually change the volume and stop the radio playing.
So in the morning; I wake up, stop the alarm and then my clever little N900 puts the volume back so the volume is correct for my car kit.

So....

To stop the radio

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days.
Select the 'time' to stop the radio.
Select a name for the alarm 'Radio Stop'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.stop
-

To start the alarm

In the Alarmed app Create a new event 'Alarm'
Select 'Weekly' and tick 'Mon-Fri' or work days.
Select the 'time' start the alarm.

-

To put the volume to full again.

In the Alarmed app Create a new event 'Command execution'
Select 'Weekly' and tick 'Mon-Fri' or work days.
Select the 'time' to two minutes after the radio alarm will stop.
Select a name for the alarm 'Volume Set Full'

Enter the following command:-
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:100
All these commands can be tweaked to personal preference's e.g.... You could have the alarm start but without the stop command, the radio will then continue to play after you silence the alarm. Or leave the radio playing and not have the alarm at all.


Hope all this helps getting your N900 radio alarm clock working.

Last edited by sixwheeledbeast; 02-21-2012 at 04:40 PM. Reason: Added code boxes.
 

The Following 3 Users Say Thank You to sixwheeledbeast For This Useful Post: