The music follows you (presence sensors, multiroom speakers)

Thanks for your reply
Sadly i don’t have Sonos devices but have lots of google devices in any room,i have created group speakers in every room and i have to say"transfer music from room to room" every time…i try different flows but no luck…
Hope Maybe one day Athom will integrate the option "join the group " like Sonos

This functionality is provided by SONOS, not Athom.
It’s up to Google to develop group joining in their products. :slightly_smiling_face: :+1:

Hey @mrPilloft ,

Better late than never :wink:

I have rewriten my flow into an Advanced Flow for my kitchen sound.
But this time i made it quite easy.

  • The main room is the TV Bar in the living room.
  • I have a Boolean(yes/No) Variable to enable the music to follow
  • Whenever there is movement in the Kitchen, and the AudioFollowKitchen variable is set to True, and the Kitchen speaker is not yet in the TV Bar Group, it will connect the kitchen into the TV Bar group.
  • I already had a timer for the Kitchen for when there is no movement for more than 5 minutes.
  • I used that timer to UnGroup the kitchen.

So far, it works perfectly and pretty simple. And i have a button in the Kitchen to toggle the AutoFollow boolean.


t

1 Like

Thanks Arie_J_Godschalk. I got inspired and created my own flows and wanted to share my experience with you (spoiler alert: not all good).

Here’s my advanced flow:

1, 2 and 3 are there rooms set up for this . (1) is my office. To get coffee, I need to go through room (2) to get to room (3). The sound follows me a) if something is playing on my “Loftstue” SONOS speaker and b) I’ve set the boolean variable “followAudio” = TRUE (4).

When going into room (2) I check (5) if I didn’t come from room (3) and if I just left room (1). If so (6), I include speaker in room (2) into the group (and set volumes for speakers in room (2) and (3)).

When going into room (3), I check if I come from room (2) (and am not just roaming around in room (3)). If so , I include speaker 3 into the SONOS speaker group.

Finally when I get back to room (1), I check if I just walked through room (2). If i did (7), I wait 5 seconds then remove the two other speakers from the group.

If I just roam around in room (1), I make sure another speaker near room (1) is included in the group.

PROS: Sometimes this works. I do not think theres anything (much?) wrong with my logic, but…
CONS: …either my speakers are old (oldest >11 years) or I have other SONOS related issued, cause very often the speakers are not included into the group. I tested with “…is playing” on some of the speakers and it was really miss’n’hit if it reported back TRUE when it was playing. The simple solution is just blindly to include/remove speakers from the group regardless if something’s playing…

Added bonus: When my wife comes home, there’s a flow that sets “followAudio”=FALSE :slight_smile:

Suggestions? I’m more than open to suggestions on how to improve my flow or do you know what my SONOS issues are (why sometimes this works, other times not (maybe a topic for a SONOS forum))?

My experience is that the Homey Sonos app is rather slow and the commands in the flows and under the cover are processed sequentially. Actions are sometimes lost in the process.

The fastest alternative I know is the node-sonos-http-api from Jishi. It is also available as a Docker container, but I have installed it natively on my Synolgy. It’s not without effort, but you’ll be rewarded with a higher performance and stability. You can also define presets, e.g. any groups with predefined volumes for each player that are activated with ONE http command. Not quite in real time, but almost.

image

Preset TV.json:

image

I’m not satisfied with the response in cards on SONOS devices myself, so this sounds interesting. Do you have a link to an install procedure?

Have a Synology DiskStation DS713+…
As my speakers are so old, I can only use the SONOS S1 app. Is that of relevance here?

I also only have older S1 speakers.

To install the node-sonos-http-api on my Synology I used the “Step-by-Step—RPi3-Install-of-Sonos-http-api” from Jishi. It works also for the Synology. Be carefull to avoid storage problems with your Synology do NOT install by mistake the api in the root directory !

Install natively on Synology

based on:

1. Package Center
git package
node package (contains npm)

2. Putty
sudo git clone https://github.com/jishi/node-sonos-http-api.git
sudo cp -R node-sonos-http-api /volume1/homes/jk/
ls (will display files folder)
cd node-sonos-http-api //The application directory is used to store all local files that are required for the execution of the programme.
Port auf 6000 umgestellt in settings.js (not absolutely necessary)
sudo npm install --production // node package manager
sudo npm start (this will start sonos-http-api service) You should see references to sonos rooms, etc

3. Set up task for restart
pm2 process manager für node
Install pm2 by running the following commands
see Step by Step RPi3 Install of Sonos http api · jishi/node-sonos-http-api Wiki · GitHub

4. Stop process + restart
ps -aux | grep npm
kill -9 npm //pm2 automatically restarts the server afterwards

1 Like

In the Homey Community Store, there is the Sonos Say app, which uses this node-sonos version aswell.

Since the sonos app will not always be aware if music is really playing, i do not check for that. I just include it into the group. If there is no music or sound playing, it will not matter.