Feature Request - Sonos Integration (alarm access)

Morning Hubitat team,

Congrats on the Sonos integration, great to see a fully featured inbuilt solution.

Is there capacity to add alarm control as switches, I’m not looking to set alarms in Hubitat but would like to see existing alarms available as switches to enable them to be turned on and off in rule machine - this is how they are exposed in Home Assistant and IMHO would be a great addition the Hubitat integration.

I'm not following, what would that do?, just mute the player?

Not mute the player as the alarm activation would override that.

My use case would be to turn the alarm off on public holidays, we usually forget and get woken up way earlier than required.

I have automations that check a google calendar and modify actions based off that, I.e roller shutters don’t go up till 9.00 am, day mode is triggered at 9.00 instead of 5.50 etc.

When I say turn off, I mean switch off the alarm prior to it going off not post alarm.

Well im confused, I don't know specifically adding a switch capability to a sonos player driver is supposed to do then.

Leaving switch capability out of it, I think it’s something like this:

  1. OP has alarms set in their Sonos ecosystem.
  2. OP wishes to use Hubitat automations to disable those alarms when the need arises.

@Jamesboag304 - is my understanding correct?

FWIW, my approach was the opposite. I deleted all my Sonos alarms, and just use Hubitat to control Sonos players as part of a morning wake up routine or a goodnight routine. Our alarms are set using iOS devices. Happy to share the iOS shortcut used to set an arbitrary alarm time on the Hubitat hub if you’re interested.

Can your alarm turn on and off a virtual switch? If so, then it would be easy to trigger Sonos to do what ever you wanted. My doorbell triggers a barking MP3 file to play on my sonos while we are away.

I didn't even know this was a Sonos thing...
All my poking around in the sonos app, never recalled seeing anything about alarms...

and a simple stop command to the player doesn't cancel this?

Yes, a stop command with stop a player that was triggered by an alarm. I believe the OP wanted to disable/enable the alarm from RM before it fired. That's possible in the Sonos App:

https://en.community.sonos.com/controllers-and-music-services-229131/sonos-alarms-still-active-but-no-way-to-stop-them-6897171 - Basically, Settings->Manage->Alarms

Via the HTTP API, I believe there are undocumented (?) actions to manage alarms - See: AlarmClock | Sonos API - See the "enabled" boolean in the UpdateAlarm action.

Overall, I'm not saying I agree with the OPs request, but I do understand it. - Personally, I would remove the alarms from Sonos entirely, and just handle it all in RM, and trigger the appropiate wakeup music/etc based on RM logic around holidays, etc. - Apparently, the OP likes the current Sonos App interface, and want's to continue to use that approach.

The above is just to give some context, hopefully.

This is exactly what I've done.

With one modification. Using RM on our phones to set/change an alarm time is a little cumbersome. So I use an Apple Shortcut along with MakerAPI & a hub variable to set a wake up alarm time that is a trigger in RM. The shortcut can be accessed as an iOS app.

This setup has worked really well, and won high marks from the better half.

The RM automation triggered by the wake up time sets the volume/station on Sonos, turns on lights, sets the temperature etc. etc.

Unless this command is available via the uPNP interface, we aren't going to be able to implement it.

It seems possible because both the Home Assistant and Node-RED Sonos integrations expose access to alarms set in the Sonos app.

Morning,

This is correct, when j say switch capability what happens in HA is individual alarms are exposes as switches, HE may not handle Sonos in the same manner therefore it may not be possible hence the question.

I could use HE to manage alarms as a whole, however Sonos integration has been flakey up to this point - hopefully this integration changes that.

Screenshot below of the HA entities of a Sonos player - setting of alarm in the Sonos app exposes a daily alarm switch.

I do have a HA instance running and could use that but I try to keep every thing in one place, otherwise things get messy- HA is purely there for my Bosch alarm panel.

We're not going to add a switch capability to the players, the best I can offer is extending the mirror apps custom mirror configuration to include applicable mapping translations for Music Player devices
these could include things like switch <-> mute, switch <-> play/stop and similar binary translations.