Hi All,
Up until recently I was able to control the default volume of my Sonos Playbar through an automation.
Background
Outside of Home Assistant, the Playbar would occasionally set the volume to 0 when there is no source for a period, so turning it back on I would need to manually turn it up each time. Usually a reset and relinking would fix this for a while, before it started doing it again. I tried all manner of HDMI control, settings, even to the point of not allowing it to turn off so the volume would stay the same…nope…back to 0.
Anyway, I used to be able to manually set the volume with script as simple as:
sequence:
- action: media_player.volume_set
target:
entity_id: media_player.sonos_speaker
data:
volume_level: 0.18
And my Automation
alias: Sonos volume on power fix
description: Fixed the Sonos volume being muted on power on
triggers:
- trigger: state
entity_id:
- media_player.tv_terrence
to:
- "on"
for:
hours: 0
minutes: 0
seconds: 6
from:
- unavailable
conditions: []
actions:
- action: media_player.volume_set
target:
entity_id: media_player.sonos_speaker
data:
volume_level: 0.18
mode: restart
Now, both scripts still run and according to the Traces, complete without issue. Problem is the Sonos is still sitting at 0. (I am using the simple script to rule out any state issues with the automation.)
In terms of the entities, I can see these states when there is no Volume:
and these when there is Volume
I have a funny feeling, the Playbar goes into some form of hibernation and doesn’t become active until it receives an input on the remote, which then sets the audio_input_format from No input to Dolby 5.1 and the media.player_sonos_speaker from idle to playing
Is there a way I can set the values for these entities before I send the volume set or does anyone know if anything has changed with the Sonos integration?
Thank you

