Skip to content

Announce

Jenx edited this page Mar 2, 2022 · 3 revisions

Announce was created to provide a common set of announcement automations. I own a SONOS system and the integration allows me to combine speakers located in different parts of the house to play the same music or make announcements. Originally all the SONOS automations were meant to be here, with scripts being called by other automations. So far this has proved unreliable and more difficult to implement. So this only contains a simple set of scripts to join and unjoin various SONOS speakers at this time.

AUTOMATIONS

None yet.

SCRIPTS

sonos_all:

Link speakers in Dining Room, Lounge, Kitchen, Garage and Master Bedroom to allow announcements throughout the house.

`sequence:
  - service: sonos.join
    data:
      master: media_player.living_room_sonos
      entity_id:
        - media_player.dining_room_sonos
        - media_player.kitchen_sonos
        - media_player.master_bedroom_sonos
        - media_player.garage`

The master SONOS device distributes the content to the linked devices. So when an announcement is made to living room SONOS its replayed on all the joined devices.

sonos_leave:

Unlink those speakers linked in sonos_all. Utilised after the announcement has been completed to return the speakers to independent operation.

FUTURE

Look at utilising common scripts for making announcements which the individual automations supply a variable that contains the announcement. This would reduce the complexity of some of my automations which contain a lot of repeated code.

OTHER

Commented out scripts are test scripts put together when experimenting with the capabilities of the SONOS integration. The importance of delays introduced became apparent here, when making announcements or unjoining it is important to include sufficient delay between commands as Home Assistant does not wait for the announcement to complete before executing the next command. This was poorly understood by me and led to a frustrating experiemntal period figuring this out.

Clone this wiki locally