jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.84k stars 461 forks source link

set Alarm #462

Open milymat opened 7 years ago

milymat commented 7 years ago

there is no possibility to add an alarm to your sonos speaker.

Could u please implement it.

jishi commented 7 years ago

Adding an alarm is a fairly complex task, you need to reference time, volume and a sonos playlist, as well as specifying weekdays when it should be triggered.

It's not a good fit for the GET based url scheme I'm using, so it's dependant on me extending the protocol to include support for more complex POST calls. Leaving this around so people can vote for it though.

How would you use it? Why is the official app inconvenient for this?

milymat commented 7 years ago

Thx for your answer.

I would use it to set the alarm via some home automation software. So the speaker are independent and if the home automation software crashed the alarm still works.

My suggestion: You could use something like: http://...//Alarm/HH/MM/PLAYLIST to set a simple alarm once

Check out these implementation, maybe I could help: https://github.com/bencevans/node-sonos/blob/master/lib/services/AlarmClock.js

Burnett2k commented 7 years ago

I created my own alarn system using the npm package node-scheduler. It is pretty easy to set up a schedule and then run whatever you code you want when the timer hits. https://www.npmjs.com/package/node-schedule

jcacavias commented 6 years ago

I'm interested in seeing this functionality. I'm working on a private voice assistant and being able to call this rest api to set an alarm would be ideal.

Blockmove commented 5 years ago

I'm also very interested in this feature. It's the only thing i'm missing. Sometimes I have shift work with different start times. I would be very usefull to set the sonos alarm clock with my homeautomation.

honato11 commented 5 years ago

Also very interested in this feature (getAlarm, setAlarm, deleteAlarm).

vjooris commented 5 years ago

One inconvenient of Sono, is that you have to be on site to manage them, and the alarms. Should it be possible to develop an interrogation returning a son with all alarms set ? And, as I do understand is is quite complex to create a new alarm, we could just modify one existing §volume, active, day(s), time) ? This should be very nice, so we could set this up remotely.

4ch1m commented 4 years ago

@jishi: Would it be possible to at least add a simple command to the existing API that lets one enable/disable existing alarms set up in the Sonos system?

Something like:

And similar to the "sayall"-endpoint:

I would love to be able to use a handy IoT-button on my nightstand to quickly turn on/off my alarms. :smile:

Thanks a bunch for the project anyway!

matthewchubb commented 3 years ago

Yes, please add this feature so that I can trigger my phone alarm, hue lights and Sonos music all with one command dependent on the random time I need to wake up the following morning! Thanks