Setting alarms on Squeezebox Radio

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Setting alarms on Squeezebox Radio

Post 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
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Setting alarms on Squeezebox Radio

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest