Page 1 of 1

Setting alarms on Squeezebox Radio

Posted: Sunday 02 January 2022 16:43
by peterbos
Hi,

I'd like to set alarms on my Squeezebox Radio (running from LMS on a piCorePLayer). I know it's an option to set the alarm in Domoticz and have Domoticz starting the alarm sound on the radio, but I prefer to set the alarm in the Radio itself to avoid not waking up because the connection between the Radio and the LMS is broken during the night (which happens sometimes).
I studied the CLI specification for the Squeezebox but can't get it working. Does anyone know how to use the CLI together with dzVents to set alarms?

Peter

Re: Setting alarms on Squeezebox Radio

Posted: Tuesday 04 January 2022 0:16
by peterbos
Today it finally worked. The dzVents code to get all alarms of the Squeezebox player at MAC address xx:xx:xx:xx:xx:xx is

Code: Select all

dz.openURL(
  {
    url = 'http://192.168.1.22:9000/jsonrpc.js',
    method = 'POST',
    headers = { ['Content-type'] = 'application/json' },
    postData = '{"id":1,"method":"slim.request","params":["xx:xx:xx:xx:xx:xx",["alarms", 0, 99, ""]]}',
    callback = 'callbackLMS'
  }   
)
In the callback function the id's of the alarms are named. To change the time of alarm 5fdd3486 you have to replace the postData with:

Code: Select all

    postData = '{"id":1,"method":"slim.request","params":["xx:xx:xx:xx:xx:xx",["alarm", "update", "id:5fdd3486", "time:36000"]]}',
The time is set in seconds after midnight. Note the difference between "id":1 and "id:5fdd3486". The first is a named field ("id") with a value 1, the other one is unnamed with value "id:5fdd3486".

Peter