Answered

Play A Greeting Through Sonos

  • 29 March 2021
  • 4 replies
  • 579 views

Hello friends,

I’m trying to figure out an automation so that when I come home that I can have a Back to the Future 2 type greeting play through my living room speakers.

I’ve Googled this idea but I can’t seem to find the answer to make it happen. 

I have only been able to get this to partially work using Yonomi. When I arrive at my house, I can get the greeting to play in the desired zone. However, I can’t seem to manage the volume and execution to time it just right. 

When I arrive at my geolocation, the Yonomi automation runs. The selected playlist then loops rather than just playing once. I’d also like to add a condition so that I have trigger a front door sensor in addition to my geolocation. 

My current home automation setup is a mix of HomeKit and Smartthings (web version). I have a Hoobs on the way for more Homekit integration of Kasa lights and my Sonos system. Things are pretty much in their beginning stages. I’m trying out different things but I will mostly be in an Apple ecosystem. 

I welcome any ideas. Thank you. 

icon

Best answer by melvimbe 30 March 2021, 15:46

View original

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

4 replies

Userlevel 7

Not sure about HomeKit, but with a SmartThings Hub, you can create an “If This, Than That” automation to play music through your Sonos speakers when a door sensor is opened. The only problem is SmartThings doesn’t allow you to specify a certain song or playlist.

If you are open to using Amazon Alexa, the “Routines” in the Alexa app work really well and it will allow you to specify a specific song or playlist to play from. I have a smart button programmed to play a specific playlist on Spotify to a specific Sonos speaker for my daughter when she pushes it. The same would work with a door sensor.

Userlevel 7

From what I can tell, using HomeKit, you can create an Automation using a HomeKit-compatible door sensor and set it to play a specific song when the door opens at a specific volume to a specific Sonos speaker. The only limitation is you have to use Apple Music to play the song.

Userlevel 7
Badge +20

If you can generate a local trigger (i.e., something that triggers a local program to run), you could use SoCo-CLI [1] to play an audio file of your choice using its ‘play_file’ action:

sonos <speaker_name> play_file greeting.mp3

There are lots of other fun Sonos automations possible with SoCo-CLI, if you’re into that kind of thing.

[1] https://github.com/avantrec/soco-cli

While I understand the appeal of the idea,  I don’t think using Sonos’ typical audio playback as the best tool to do this sort of thing.    I say this because it’s a bit difficult to get the trigger timing right and consistent, considering all the moving parts.  The other is that playing audio track on a Sonos speakers effectively clears the queue, and forgets what it was playing before. 

So if you get this setup to play a greeting on your living room, when the front door is opened, all is fine when you come home from work (if the greeting happens right away), but if you were listening to music and happen to open the front door, you’ve just killed the music you were playing in order to play the greeting.  You’ll have to go into the Sonos app to start up the music.

If you used a voice assistant enabled speaker (Sonos or otherwise), that is specifically designed to ‘speak’ separately than music playback, than you avoid that problem. As @GuitarSuperstar was stating other, Alexa routines work well for this sort of thing.  You could trigger a routine off a door sensor, with the action simply being for Alexa to say  “welcome home chillybase”.  If music was playing at the time, it would ‘duck’ temporarily and resume after Alexa is done speaking.