···25252626If you have other Sources configured for Multi-Scrobbler that you may play *through Sonos* you should try to add Sonos to the "deny" list for that Source so that it does not try to monitor Sonos activity. Check the documentation for each individual Source to see how to configure this exclusion.
27272828-An example of this for [Plex](/configuration/sources/plex) would be to add Sonos to the "block" list ENV EX: `PLEX_DEVICES_BLOCK=sonos`
2828+For example, to prevent the [Plex](/configuration/sources/plex) Source from monitoring audio played through Sonos, add Sonos to the "block" list ENV EX: `PLEX_DEVICES_BLOCK=sonos`
29293030:::
3131+3232+<details>
3333+3434+<summary>How to report issues</summary>
3535+3636+If your Sonos Source is logging errors or the scrobble data is not as expected please [create a bug report](https://github.com/FoxxMD/multi-scrobbler/issues/new?template=01-bug-report.yml) **after** enabling the following debug logging options based on the config type you have:
3737+3838+<Tabs groupdId="sonosBugConfig">
3939+<TabItem value="env" label="ENV">
4040+4141+Enable [Debug Mode](/configuration#debug-mode) using `DEBUG_MODE=true`
4242+4343+</TabItem>
4444+<TabItem value="file" label="File">
4545+4646+Enable `logPayload` and `logFitlerFailure` in your `sonos.json`, or AIO file, config:
4747+4848+```json
4949+[
5050+ {
5151+ "enable": true,
5252+ "name": "MySonos",
5353+ "data": {
5454+ "host": "192.168.0.150"
5555+ },
5656+ "options": {
5757+ "logFilterFailure": "warn",
5858+ "logPayload": true
5959+ }
6060+ }
6161+]
6262+```
6363+6464+</TabItem>
6565+6666+</Tabs>
6767+6868+Additional logging for the Sonos library may be enabled by including this environmental variable (regardless of config type):
6969+7070+```
7171+DEBUG=sonos:*
7272+```
7373+7474+The above changes:
7575+7676+* Triggers multi-scrobbler to log the raw data recieved from Sonos when a new track/device/service is seen for the first time
7777+* Trigger multi-scrobbler to log the reason it considers a play from Sonos as invalid (and will not monitor it)
7878+* Logs low-level activity from the Sonos library
7979+8080+Please include these additional logs when creating a bug report. They are essential to troubleshooting your issue.
8181+8282+</details>
31833284## Configuration
3385
+6-2
src/backend/sources/SonosSource.ts
···129129 let status = CLIENT_PLAYER_STATE[x.state.transportState];
130130131131 let seen = true;
132132- if (!this.mediaIdsSeen.data.includes(x.state.positionInfo.TrackURI)) {
132132+133133+ // TrackURI seems to correspond to 1) the device/group playing and 2) the service/source playing
134134+ // but NOT the content actually playing -- 2) does not update when content playing changes on the same service
135135+ const mediaId = `${x.state.positionInfo.TrackURI}--${typeof x.state.positionInfo.TrackMetaData !== 'string' ? x.state.positionInfo.TrackMetaData.TrackUri : x.state.positionInfo.TrackMetaData}`;
136136+ if (!this.mediaIdsSeen.data.includes(mediaId)) {
133137 seen = false;
134134- this.mediaIdsSeen.add(x.state.positionInfo.TrackURI);
138138+ this.mediaIdsSeen.add(mediaId);
135139 if (this.config.options?.logPayload || isDebugMode()) {
136140 this.logger.debug({ device: { Name, GroupName, Uuid }, state: x.state }, 'Sonos Data');
137141 }