Additional information
It is possible to retrieve even more information / control more aspects of your Samsung soundbar, by utilizing the (undocumented) execute status.
As the API states,
it is possible to execute custom commands. You can retrieve the status / values of your
custom command in the data
attribute when fetching new information of the device.
Expand to see a sample of the fetched data of a soundbar device
This is a dictionary fetched by a pysmartthings.device.status.attributes
after a device.status.refresh()
.
{
'supportedPlaybackCommands': status(value=['play', 'pause', 'stop'], unit=None, data=None),
'playbackStatus': status(value='paused', unit=None, data=None),
'mode': status(value=10, unit=None, data=None),
'detailName': status(value='TV', unit=None, data=None),
'volume': status(value=16, unit='%', data=None),
'supportedInputSources': status(value=['digital', 'HDMI1', 'bluetooth', 'wifi'], unit=None, data=None),
'inputSource': status(value='digital', unit=None, data=None),
'data': status(
value={
'payload': {
'rt': ['x.com.samsung.networkaudio.eq'],
'if': ['oic.if.rw', 'oic.if.baseline'],
'x.com.samsung.networkaudio.supportedList': ['NONE', 'POP', 'JAZZ', 'CLASSIC', 'CUSTOM'],
'x.com.samsung.networkaudio.EQname': 'NONE',
'x.com.samsung.networkaudio.action': 'setEQmode',
'x.com.samsung.networkaudio.EQband': ['0', '0', '0', '0', '0', '0', '0']
}
},
unit=None,
data={'href': '/sec/networkaudio/eq'}
),
'switch': status(value='on', unit=None, data=None),
'role': status(value=None, unit=None, data=None),
'channel': status(value=None, unit=None, data=None),
'masterName': status(value=None, unit=None, data=None),
'status': status(value=None, unit=None, data=None),
'st': status(value='1970-01-01T00:00:28Z', unit=None, data=None),
'mndt': status(value='2022-01-01', unit=None, data=None),
'mnfv': status(value='HW-Q935BWWB-1010.0', unit=None, data=None),
'mnhw': status(value='', unit=None, data=None),
'di': status(value='##############################', unit=None, data=None),
'mnsl': status(value=None, unit=None, data=None),
'dmv': status(value='res.1.1.0,sh.1.1.0', unit=None, data=None),
'n': status(value='Samsung Soundbar Q935B', unit=None, data=None),
'mnmo': status(value='HW-Q935B', unit=None, data=None),
'vid': status(value='VD-NetworkAudio-002S', unit=None, data=None),
'mnmn': status(value='Samsung Electronics', unit=None, data=None),
'mnml': status(value=None, unit=None, data=None),
'mnpv': status(value='6.5', unit=None, data=None),
'mnos': status(value='Tizen', unit=None, data=None),
'pi': status(value='##################################', unit=None, data=None),
'icv': status(value='core.1.1.0', unit=None, data=None),
'mute': status(value='unmuted', unit=None, data=None),
'totalTime': status(value=174590, unit=None, data=None),
'audioTrackData': status(value={'title': 'QUIET', 'artist': 'ELEVATION RHYTHM', 'album': ''}, unit=None, data=None),
'elapsedTime': status(value=28601, unit=None, data=None)
}
The data
attribute can also be fetched separately with an undocumented API endpoint.
url = f"https://api.smartthings.com/v1/devices/{self._device_id}/components/main/capabilities/execute/status"
It seems that the normal device.status.refresh()
retrieves cached results from the execute status. Therefore
using this endpoint separately seems to be a better solution.
To set the status of a given setting a command needs to be issued with the following (sample) structure:
data = {
"commands": [
{
"component": component_id,
"capability": capability,
"command": command,
"arguments": ["/sec/networkaudio/advancedaudio"]
}
]
}
To set a setting, you will "update" an object in the given path, with a payload similar to the following:
data = {
"commands": [
{
"component": component_id,
"capability": capability,
"command": command,
"arguments": ["/sec/networkaudio/advancedaudio", {"x.com.samsung.networkaudio.bassboost": 1}]
}
]
}
Soundmode
This setting has the href: "/sec/networkaudio/soundmode"
A sample status looks like this:
{
'data': {
'value': {
'payload': {
'rt': ['x.com.samsung.networkaudio.soundmode'],
'if': ['oic.if.a', 'oic.if.baseline'],
'x.com.samsung.networkaudio.soundmode': 'adaptive sound',
'x.com.samsung.networkaudio.supportedSoundmode': ['standard', 'surround', 'game', 'adaptive sound']
}
},
'data': {'href': '/sec/networkaudio/soundmode'},
'timestamp': '2023-09-05T14:59:50.581Z'
}
}
Advanced Audio
This setting has the href: "/sec/networkaudio/advancedaudio"
A sample status looks like this:
{
'data': {
'value': {
'payload': {
'rt': ['x.com.samsung.networkaudio.advancedaudio'],
'if': ['oic.if.rw', 'oic.if.baseline'],
'x.com.samsung.networkaudio.voiceamplifier': 0,
'x.com.samsung.networkaudio.bassboost': 0,
'x.com.samsung.networkaudio.nightmode': 0
}
},
'data': {'href': '/sec/networkaudio/advancedaudio'},
'timestamp': '2023-09-05T15:00:14.665Z'
}
}
Subwoofer
This setting has the href: "/sec/networkaudio/woofer"
A sample status looks like this:
{
'value': {
'payload': {
'rt': ['x.com.samsung.networkaudio.woofer'],
'if': ['oic.if.a', 'oic.if.baseline'],
'x.com.samsung.networkaudio.woofer': 3,
'x.com.samsung.networkaudio.connection': 'on'
}
},
'data': {'href': '/sec/networkaudio/woofer'},
'timestamp': '2023-09-05T14:57:36.450Z'
}
Equalizer
This setting has the href: "/sec/networkaudio/eq"
A sample status looks like this:
{
'data': {
'value': {
'payload': {
'rt': ['x.com.samsung.networkaudio.eq'],
'if': ['oic.if.rw', 'oic.if.baseline'],
'x.com.samsung.networkaudio.supportedList': ['NONE', 'POP', 'JAZZ', 'CLASSIC', 'CUSTOM'],
'x.com.samsung.networkaudio.EQname': 'NONE',
'x.com.samsung.networkaudio.action': 'setEQmode',
'x.com.samsung.networkaudio.EQband': ['0', '0', '0', '0', '0', '0', '0']
}
},
'data': {'href': '/sec/networkaudio/eq'},
'timestamp': '2023-09-05T14:59:03.490Z'
}
}
Volume
This setting has the href: "/sec/networkaudio/audio"
A sample status looks like this:
{
'data': {
'value': {'payload': {'rt': ['oic.r.audio'], 'if': ['oic.if.a', 'oic.if.baseline'], 'mute': False, 'volume': 3}},
'data': {'href': '/sec/networkaudio/audio'},
'timestamp': '2023-09-05T15:09:04.980Z'
}
}