htvekov / openHASP-Sonos-media-player

openHASP Sonos group media player - Multiple plate configuration support
16 stars 1 forks source link
home-assistant openhasp sonos sonos-controller



openHASP Sonos group player - multiple plates documentation v1.05

T3E Sonos media player plate

Revision:

Prerequisities:

Description:

With this openHASP Sonos plate configuration, you’ll be able to control single or grouped Sonos speakers from multiple openHASP plates. Plates just have to share identical object mapping (page/object number).

Approach was to make this setup as dynamic as possible. The original design with a designated hardcoded master speaker has now been abandoned and replaced with a fully dynamic group speaker configuration. Now it's possible to change both master- and slave speakers and jump between all active groups or single speakers by changing the Master Speaker. By design, all plates will always display the same chosen speaker group.

I also wanted to keep mqtt 'chatter' to a minimum and have mainly used mqtt group topics and not entities for boths triggers and actions. Hence the configuration logic is entirely done as automations and not as Custom Component configuration. As configuration is quite elaborate, a multi plate Custom Component configuration for eg. five plates would also have exceeded more than 4000 lines !

This configuration only allows control of all speakers volume as a global group. So no individual volume setting is possible from plates. Joining new slave speakers to the group, will also set new speakers volume to match master speakers volume - before it’s joined.

Configuration templates will split all Sonos Favourites in two groups, but will need a little help from you to determine what belongs to which group. All ‘non sources’ (playlists, songs, podcasts etc. from e.g. Spotify) should be renamed and prefixed with an asteriks ‘*’ (No extra spaces, just an asteriks). Renaming is easily done directly in the Sonos app or via Sonos web interface.

Sources (radio stations) unfortunately doesn’t follow any strict rules on how to present media meta data. So some radio stations will unfortunately appear on plate with artist/title mixed up. Source in Sonos Favourites can be renamed and suffixed with a ‘|’ pipe symbol (No extra spaces, just a pipe symbol). Templates in config will seek out this pipe symbol and swap title/artist on plate display. Symbol will also be hidden in dropdown list, pop-up info etc. Special fix for handling danish national radio stations is hardcoded in templates:

Example below:

media_title: Elephant Woman / Blonde Redhead

Keywords:

Configuration consists of four elements:

Following needs to be done for config to work !!

Changes in Sonos app:

Examples:

FV:2/44: '*New Music Friday Denmark'
FV:2/47: '*The Ultimate Hit Mix'
FV:2/49: Classic FM
FV:2/54: Classic Rock|
FV:2/63: DR Nyheder

Changes in configuration files:

Changes in Home Assistant:

General:

openHASP design:

’To do’ list:

Suggestions, improvements, error reporting etc. are very welcome ! 🙂

February, 2023 @htvekov

Below, various images showing the tab views and the pop up info overlay object:

T3E Source dropdown list

T3E source dropdown list

T3E Playlist dropdown list

T3E playlist dropdown list

T3E Slave speaker selection buttons

T3E slave speaker selection buttons

T3E Slave speaker selection buttons

T3E pop-up info overlay object

WT32_SC01 Plus 320 x 480 res. layout

WT32_SC01 Plus source dropdown list

WT32_SC01 Plus slave speaker selection buttons

Sunton 480 x 800 res. layout

Sunton pop-up info overlay object

Sunton source dropdown list

Sunton Master speaker button and Master speaker button matrix

Sunton pop-up info overlay object