PDA

View Full Version : Toggle Alarm on / off with commandline?



DiSNEYN
2010-12-08, 00:42
Hello!

Please help me to get a command that i can run from a command line box that toggles alarm on and off. The reason i want this is to make sure my alarm is enabled every morning!

Somthing like this:

C:\squeezeserver\squeezeserver.exe alarm boom_bedroom off

C:\squeezeserver\squeezeserver.exe alarm boom_bedroom on

Thanks.
/Hans

Soulkeeper
2010-12-08, 03:19
Does your Boom alarm turn itself off by itself? In that case, the easiest/best solution might be to disable mysqueezebox.com integration in SBS.

DiSNEYN
2010-12-08, 09:42
no, it is just me. im building a system to always make sure that thw alarm is enabled. even if i as forgot to turn the alarm back on.

i will eplain. in the morning when i wake of one of my 4 alarms, i have one 06.00, 06.15, 06.30, 07.00.

if i wake 06.00 i turn off the alarm so i dont have to go up to my bedroom and turn it off at the ofter alarm times that are left e.g 06.15, 06.30, 07.00

sometimes i forget to enable the alarm agin before i go to bed.
therefor im buildning a script that always make sure that the alarm is enabled.

right now im construction a complex script in autoit, but it would make it a lot easier if i could set all alarm on / off via command line..

DiSNEYN
2010-12-09, 00:07
no, it is just me. im building a system to always make sure that thw alarm is enabled. even if i as forgot to turn the alarm back on.

i will eplain. in the morning when i wake of one of my 4 alarms, i have one 06.00, 06.15, 06.30, 07.00.

if i wake 06.00 i turn off the alarm so i dont have to go up to my bedroom and turn it off at the ofter alarm times that are left e.g 06.15, 06.30, 07.00

sometimes i forget to enable the alarm agin before i go to bed.
therefor im buildning a script that always make sure that the alarm is enabled.

right now im construction a complex script in autoit, but it would make it a lot easier if i could set all alarm on / off via command line..


is there a way to go in to direct to the configuration web-interface for the Squeezebox Boom?

JJZolx
2010-12-09, 00:17
Looks like this can be done through the CLI (Squeezebox Server's command line interface, which works over telnet). You may be able to use the built-in Windows telnet client or a 3rd party one and perhaps wrap it in a batch file.

For documentation of the CLI go to the server's web interface:

Help > Technical Information > The Squeezebox Server Command Line Interface

Find 'Alarm commands and queries'

<playerid> alarm <add|update|delete|enableall|disableall|defaultvolu me> <taggedParameters>

Pascal Hibon
2010-12-09, 02:55
Managing your alarms would be a lot easier by using a remote such as iPeng on your iPod Touch or iPhone. This way you donít even need different alarms for different times (only one will do) and it is very easy for you switch them on and off and adjust the alarm time. http://penguinlovesmusic.de/

DiSNEYN
2010-12-09, 07:28
Managing your alarms would be a lot easier by using a remote such as iPeng on your iPod Touch or iPhone. This way you donít even need different alarms for different times (only one will do) and it is very easy for you switch them on and off and adjust the alarm time. http://penguinlovesmusic.de/

I allready use iPeng on my iPhone, but then i must remeber to enable the alarm every night before i go to bed. I want more than one alarm to make sure i go upp. I know it's easy to switch on / off on the iPeng but that don't solve my problem.

/Hans

DiSNEYN
2010-12-09, 07:32
Looks like this can be done through the CLI (Squeezebox Server's command line interface, which works over telnet). You may be able to use the built-in Windows telnet client or a 3rd party one and perhaps wrap it in a batch file.

For documentation of the CLI go to the server's web interface:

Help > Technical Information > The Squeezebox Server Command Line Interface

Find 'Alarm commands and queries'

<playerid> alarm <add|update|delete|enableall|disableall|defaultvolu me> <taggedParameters>

This is very interesting, thanks for the tip! I shall take and read a bit more about it. Perhaps this is a simple solution ..

Thanks!

/Hans

Pascal Hibon
2010-12-09, 07:37
I allready use iPeng on my iPhone, but then i must remeber to enable the alarm every night before i go to bed. I want more than one alarm to make sure i go upp. I know it's easy to switch on / off on the iPeng but that don't solve my problem.

/Hans

A way to remind you every night is to setup an event in your iPhone calendar. It is possible to make it recurring (every night) and to alert you.
I know this is not what you were asking about either but I think it will be easier than creating a script that toggles alarms on and off by using CLI commands.

DiSNEYN
2010-12-09, 07:49
A way to remind you every night is to setup an event in your iPhone calendar. It is possible to make it recurring (every night) and to alert you.
I know this is not what you were asking about either but I think it will be easier than creating a script that toggles alarms on and off by using CLI commands.

I've already created a script in autoit (windows script language) that send keystrokes to control the web-interface.. it is Scheduled to run every night 04:00

Here is the script, customized for my player:

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.0.0


#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here


Opt('SendKeyDelay', 20)

For $i = 1 To 5
If ProcessExists('boxee.exe') Then
ProcessClose('boxee.exe')
Sleep(1000)
Else
ExitLoop
EndIf
Next

For $i = 1 To 5
If ProcessExists('xbmc.exe') Then
ProcessClose('xbmc.exe')
Sleep(1000)
Else
ExitLoop
EndIf
Next

$url = 'http://localhost:9000'
Run(@comspec & ' /c start ' & $url,'',@sw_hide)
Sleep (15000)
Send ("{TAB 26}")
Send ("{Enter}")
Sleep (15000)
Send ("{TAB 3}")
Sleep (1500)
Send ("A")
Send ("{Enter}")
Sleep (15000)
Send ("{TAB 2}")
Send ("{DOWN}")
Send ("{TAB 54}")
Sleep (5000)
Send ("{Enter}")
Sleep (10000)

For $i = 1 To 5
If ProcessExists('firefox.exe') Then
ProcessClose('firefox.exe')
Sleep(1000)
Else
ExitLoop
EndIf
Next

---

/Hans