Bug
The Sound Output select entity (BraviaSoundOutputSelect) is permanently unknown because its initial-state fetch reads the wrong API endpoint.
In custom_components/bravia_rest_api/select.py, async_added_to_hass does:
settings = await self.coordinator.client.get_speaker_settings(
"outputTerminal"
)
But outputTerminal is a sound setting, not a speaker setting. Sony's audio service returns it via getSoundSettings (version 1.1), while getSpeakerSettings only handles targets like tvPosition / subwooferLevel. Asking getSpeakerSettings for outputTerminal fails (Illegal Argument on my set), the except BraviaError: pass swallows it, and self._current stays None forever — so the select shows unknown even though the TV happily reports the value.
Notably, bravia_client.py has set_sound_settings() (→ setSoundSettings v1.1), which is why setting the output works fine — but there is no get_sound_settings() read counterpart at all.
Environment
- Integration: v1.5.5 (HACS)
- TV: Sony KD-85X91J, PSK auth
- The set path (
select_option / set_audio_output service) works correctly; only the readback is broken.
Reproduction
- Add a KD-85X91J (or presumably any Bravia) via PSK.
- Observe
select.*_sound_output is unknown and never populates.
- Raw API confirms the TV reports the value via the sound-settings endpoint:
curl -s -H "X-Auth-PSK: $PSK" -d '{"method":"getSoundSettings","id":1,"params":[{"target":"outputTerminal"}],"version":"1.1"}' http://TV_IP/sony/audio
# → {"result":[[{"target":"outputTerminal","currentValue":"audioSystem", ...}]],"id":1}
- The endpoint the integration actually calls returns an error for this target:
curl -s -H "X-Auth-PSK: $PSK" -d '{"method":"getSpeakerSettings","id":1,"params":[{"target":"outputTerminal"}],"version":"1.0"}' http://TV_IP/sony/audio
# → {"error":[3,"Illegal Argument"],"id":1}
Suggested fix
Add the missing read method to bravia_client.py, mirroring set_sound_settings:
async def get_sound_settings(
self, target: str = ""
) -> list[dict[str, Any]]:
"""Get sound settings (e.g., output terminal)."""
result = await self._request(
SERVICE_AUDIO, "getSoundSettings", [{"target": target}], version="1.1"
)
return result[0] if result and isinstance(result[0], list) else result
and switch async_added_to_hass in select.py to get_sound_settings("outputTerminal").
Ideally the entity would also refresh this value on coordinator updates (or at least via _handle_coordinator_update) instead of fetching once at startup — external changes (TV remote, eARC handshakes) currently never propagate even after the fix above.
Happy to open a PR for this — it's a small, self-contained change.
Bug
The Sound Output select entity (
BraviaSoundOutputSelect) is permanentlyunknownbecause its initial-state fetch reads the wrong API endpoint.In
custom_components/bravia_rest_api/select.py,async_added_to_hassdoes:But
outputTerminalis a sound setting, not a speaker setting. Sony's audio service returns it viagetSoundSettings(version1.1), whilegetSpeakerSettingsonly handles targets liketvPosition/subwooferLevel. AskinggetSpeakerSettingsforoutputTerminalfails (Illegal Argument on my set), theexcept BraviaError: passswallows it, andself._currentstaysNoneforever — so the select showsunknowneven though the TV happily reports the value.Notably,
bravia_client.pyhasset_sound_settings()(→setSoundSettingsv1.1), which is why setting the output works fine — but there is noget_sound_settings()read counterpart at all.Environment
select_option/set_audio_outputservice) works correctly; only the readback is broken.Reproduction
select.*_sound_outputisunknownand never populates.Suggested fix
Add the missing read method to
bravia_client.py, mirroringset_sound_settings:and switch
async_added_to_hassinselect.pytoget_sound_settings("outputTerminal").Ideally the entity would also refresh this value on coordinator updates (or at least via
_handle_coordinator_update) instead of fetching once at startup — external changes (TV remote, eARC handshakes) currently never propagate even after the fix above.Happy to open a PR for this — it's a small, self-contained change.