Follow Me Sonos

I found a lot of times I will plan on running into my office for what I think will be 5 minutes and I end up staying there for over an hour. Using room presence I created a little automation that notices when I change rooms, waits a few minutes in case I just ran in to grab something, and then will group the speakers in my office or basement with whatever room I came from. It looks to see if sonos was playing in the room I left, and as long as it was playing and the room I enter is not already on or listening to something else it will join them together, It works great, I did not ungroup speakers once leaving a room, just because alot of times I will have a couple rooms on anyway…this will just add rooms as i move about.

sensor.dustin is happy bubbles precense detectors. It detects me within a room within a couple seconds and has been extremly accurate

Here is an example of going between two rooms

Automations
- alias: Follow me Sonos Office Living Room
  trigger:
    - platform: state
      entity_id: sensor.dustin
      to: 'Living Room'
      from: 'Office'
      for:
        minutes: 3
  condition:
    - condition: state
      entity_id: media_player.office
      state: 'playing'
    - condition: state
      entity_id: media_player.living_room
      state: 'paused'
  action:
    - service: script.turn_on
      entity_id: script.sonos_join_office_liv

- alias: Follow me Sonos Living Room-Office
  trigger:
    - platform: state
      entity_id: sensor.dustin
      to: 'Office'
      from: 'Living Room'
      for:
        minutes: 3
  condition:
    - condition: state
      entity_id: media_player.living_room
      state: 'playing'
    - condition: state
      entity_id: media_player.office
      state: 'paused'
  action:
    - service: script.turn_on
      entity_id: script.sonos_liv_office


Scripts
sonos_join_office_liv:
  alias: Sonos Join Living Room Office
  sequence:
    service: media_player.sonos_join
    data:
      master: media_player.office
    entity_id:
      - media_player.office
      - media_player.living_room

sonos_liv_office:
  alias: Sonos Join Office And Living Room
  sequence:
    service: media_player.sonos_join
    data:
      master: media_player.living_room
    entity_id:
      - media_player.living_room
      - media_player.office
6 Likes

Very cool :+1:

I think a wow factor may be to move the media from one player to the other instead of grouping players as you move around, if even possible.

1 Like

Hi! Do you trigger the happy bubbles precense detectors with phone?

Hey! I dont use my phone for that. I started with a Tile but it was way to strong. I use the little white one that the happy bubbles fella sells. It works perfect, you can turn down how strong a signal is which took away all my issues of it jumping from room to room, its dead on accurate now.

I did stick that tile in my glove box and its perfect for that. its so strong it sees me right when im turning in my driveway. THat and the bayesian sensor has made my home/away rock solid too