1.05 (2023-02-27) Migration of the last CC entries to automations now completed. Configuration now only consists of sensors in configuration.yaml and logic in automations.yaml
1.04 (2023-02-23) Configuration now supports multiple, simultanious plates with varying display width. openHASP entities are now added dynamically as well. Only need to enter one initial plate entity_id and one initial Sonos speaker entity. Automations will populate groups dynamically
1.03 (2023-02-11) Added 480x800 res. display layout (Sunton 5 and 7" devices). Master speaker entity is now dynamic and can be altered directly from plate -> All groups or single players can be controlled and/or altered.
1.02 (2023-01-30)
Removed zoom
service calls as Custom Component now support image upscaling. Requires openHASP Custom Component from main
branch commit b2ed186
or newer
1.01 (2023-01-28) Added revised layout (portrait mode) for 320x480 resolution devices
1.00 (2023-01-25)
Removed all hardcoded media player entities from automations- and config yaml files. Designated master speaker entity_id
now only need to be entered in group.sonos_all
Cleaned up the hardcoded openHASP plate entities as well. Some nine entities are left in total, where only five of these are actually needed.
Configuration prepared to run either multiple 320x480 or 480x480 res. devices without further alterations (besides the device entity_id)
main
branch commit b2ed186
or newer required (January 30th, 2023)push_image
functionWith 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:
media_title
attribute is done as well. This is needed as quite a few danish broadcasters meta data has both title and artist combined in the media_title
attribute - only separated with a ' [SPACE]/[SPACE]'. Example below:
media_title: Elephant Woman / Blonde Redhead
Source/playlist album image is displayed as background for the entire page. All other overlaying objects are drawn with varying opacity on top of the source/album image
Play/pause pop-up info overlay (5 sec.) shows info about playlist- or source name, origin (TuneIn (somewhat irregular) and Spotify source detection) and playing status
Source/playlist dropdown list selection via image object button
Master speaker selection
480 x 800 resolution. layout
320 x 480 and 480 x 480 resolution layouts
Slave speaker selection
480 x 800 resolution. layout
320 x 480 and 480 x 480 resolution layouts
Shuffle/repeat buttons and progress bar are disabled playing sources
Automation will update progress bar every 5 seconds while playing non sources. Progress bar is shown between artist and title objects
Play/pause button will play/pause (Sonos don’t use stop function. Only when idle)
Volume mute button will mute/unmute whole group of speakers
Volume slider will change volume setting for the whole group of speakers. Volume level indicated on the right - inside the slider. At high volume (above 75 on plate = 'real' volume at 60) indicator will be placed on the left side instead
Title/artist are displayed
Primary- and active slave speakers friendly names are also displayed (active group)
groups.yaml
containing needed Home Assistant groupsconfiguration.yaml
containing all support 'helper' sensors. Both 'standard'-, mqtt- and binary sensors. File also contains the optional page 0 objectsautomations.yaml
containing all needed logicjsonl
file containing all the objectsChanges 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:
Copy all page 2 objects from either sunton_jsonl
, gs_t3e.jsonl
or wt32_01_plus.jsonl
to your existing openHASP jsonl file. I've included my page 0 objects as well in the files, so you can copy the entire page layout if you want.
sunton.jsonl
file gs_t3e.jsonl
filewt32_01_plus.jsonl
filePopulate group.sonos_all
in groups.yaml
file with your initial master speaker entity_id
only. Remaining speaker entities will be populated dynamically
Populate group.hasp_sonos_devices
in groups.yaml
file with your primary openHASP plate entity_id
. Group will be dynamically expanded and populated with all available openHASP entities - sorted in alphabetical order
group.sonos_all_speakers
should be left untouched and unpopulated. It will be populated upon HA start and dynamically revised upon speaker availability change
Copy all sensors from configuration.yaml
to your own configuration file. Note that there are three different sensor types, so take care to paste these in under the correct sensor type slug (sensor, mqtt and binary_sensor)
In top of configuration.yaml
file, I've included my four page 0 Custom Component object entries, if you want to include these as well (not mandatory). Search for t3e_02
(my plate name) and replace with your plate name. There are five hardcoded openHASP entities in the Custom Component part of theconfiguration.yaml
file
Changes in Home Assistant:
sensor.sonos_favorites
for the configuration to work. Check HA Sonos integration to find details on thissensor.local_ip
{{states('sensor.local_ip')}}
in automations.yaml
and replace with your HA local IP addressGeneral:
openhasp.png
file to plate. Reboot HA and plate(s) and you’re ready ! 🙂Suggestions, improvements, error reporting etc. are very welcome ! 🙂
February, 2023 @htvekov