CFenner/MMM-Sonos

Playbar TV output

CommanderB opened this issue · 11 comments

One of my Sonos units is a Playbar; when it is in 'TV mode', playing the audio from the TV it displays on the MM as a playing unit with just a square dot in place of the album art. (showStoppedRoom is set to false)

Can this be suppressed?

I don't have a Playbar, could you provide the JSON data of the Sonos API with the Playbar in TV Mode?

Um... probably, but I'm a lot of a n00b - how would I do that (sorry)

just type in the browser the Pi ip with the SonosAPI port and "/zones".
For me this would be http://192.168.178.31:5005/zones and it returns this:

[{
    "uuid": "",
    "coordinator": {
        "uuid": "",
        "state": {
            "currentTrack": {
                "artist": "Ayhan Sicimoğlu",
                "title": "Istanbul Pas Constantinople",
                "album": "Friends & Family",
                "albumArtURI": "/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a1hVKhvNCi3OQR8OGRETura%3fsid%3d9%26flags%3d8224%26sn%3d1",
                "duration": 272,
                "uri": "x-sonos-spotify:spotify%3atrack%3a1hVKhvNCi3OQR8OGRETura?sid=9&flags=8224&sn=1",
                "radioShowMetaData": "",
                "absoluteAlbumArtURI": "https://i.scdn.co/image/4bff8c014ae6e39383ae63ca61a38172547db5bf",
                "streamInfo": "",
                "type": "track"
            },
            "nextTrack": {
                "uri": "x-sonos-spotify:spotify%3atrack%3a3DClpqCRz64v6PYMCUNwok?sid=9&flags=8224&sn=1",
                "albumArtURI": "/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a3DClpqCRz64v6PYMCUNwok%3fsid%3d9%26flags%3d8224%26sn%3d1",
                "absoluteAlbumArtURI": "https://i.scdn.co/image/0d617769c8ba01ccc69460b244ffd894d467ca7b",
                "title": "Flying Market",
                "artist": "Hoosky",
                "album": "Just a Lil' Beat, Vol. 1 (OOgo & Chomsk')"
            },
            "volume": 14,
            "mute": false,
            "trackNo": 221,
            "elapsedTime": 2,
            "elapsedTimeFormatted": "00:02",
            "zoneState": "PAUSED_PLAYBACK",
            "playerState": "PAUSED_PLAYBACK",
            "zonePlayMode": {
                "shuffle": false,
                "repeat": false,
                "crossfade": false
            }
        },
        "playMode": {
            "shuffle": false,
            "repeat": false,
            "crossfade": false
        },
        "roomName": "Küche",
        "coordinator": "",
        "groupState": {
            "volume": 14,
            "mute": false
        }
    },
    "members": [{
        "uuid": "",
        "state": {
            "currentTrack": {
                "artist": "Ayhan Sicimoğlu",
                "title": "Istanbul Pas Constantinople",
                "album": "Friends & Family",
                "albumArtURI": "/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a1hVKhvNCi3OQR8OGRETura%3fsid%3d9%26flags%3d8224%26sn%3d1",
                "duration": 272,
                "uri": "x-sonos-spotify:spotify%3atrack%3a1hVKhvNCi3OQR8OGRETura?sid=9&flags=8224&sn=1",
                "radioShowMetaData": "",
                "absoluteAlbumArtURI": "https://i.scdn.co/image/4bff8c014ae6e39383ae63ca61a38172547db5bf",
                "streamInfo": "",
                "type": "track"
            },
            "nextTrack": {
                "uri": "x-sonos-spotify:spotify%3atrack%3a3DClpqCRz64v6PYMCUNwok?sid=9&flags=8224&sn=1",
                "albumArtURI": "/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a3DClpqCRz64v6PYMCUNwok%3fsid%3d9%26flags%3d8224%26sn%3d1",
                "absoluteAlbumArtURI": "https://i.scdn.co/image/0d617769c8ba01ccc69460b244ffd894d467ca7b",
                "title": "Flying Market",
                "artist": "Hoosky",
                "album": "Just a Lil' Beat, Vol. 1 (OOgo & Chomsk')"
            },
            "volume": 14,
            "mute": false,
            "trackNo": 221,
            "elapsedTime": 2,
            "elapsedTimeFormatted": "00:02",
            "zoneState": "PAUSED_PLAYBACK",
            "playerState": "PAUSED_PLAYBACK",
            "zonePlayMode": {
                "shuffle": false,
                "repeat": false,
                "crossfade": false
            }
        },
        "playMode": {
            "shuffle": false,
            "repeat": false,
            "crossfade": false
        },
        "roomName": "Küche",
        "coordinator": "",
        "groupState": {
            "volume": 14,
            "mute": false
        }
    }]
}]

Would you prefer to hide the speakers in tv mode?

Yours got better formatting than me - Its Family Room/Family Room Playbar (192.168.1.46)

Ideally I'd like it to not show when its in TV mode, but to show when being a regular Sonos. This capture is from it in TV mode.

[{
    "uuid": "",
    "coordinator": {
        "uuid": "",
        "state": {
            "currentTrack": {
                "artist": "",
                "title": "WCBS Newsradio 880",
                "album": "",
                "albumArtURI": "/getaa?s=1&u=x-sonosapi-stream%3as27760%3fsid%3d254%26flags%3d8224%26sn%3d0",
                "duration": 0,
                "uri": "x-sonosapi-stream:s27760?sid=254&flags=8224&sn=0",
                "radioShowMetaData": "",
                "absoluteAlbumArtURI": "http://192.168.1.51:1400/getaa?s=1&u=x-sonosapi-stream%3as27760%3fsid%3d254%26flags%3d8224%26sn%3d0",
                "streamInfo": "",
                "type": "radio"
            },
            "nextTrack": {
                "artist": "",
                "title": "",
                "album": "",
                "albumArtURI": "",
                "duration": 0,
                "uri": ""
            },
            "volume": 15,
            "mute": false,
            "trackNo": 1,
            "elapsedTime": 0,
            "elapsedTimeFormatted": "00:00",
            "zoneState": "STOPPED",
            "playerState": "STOPPED",
            "zonePlayMode": {
                "shuffle": false,
                "repeat": false,
                "crossfade": false
            }
        },
        "playMode": {
            "shuffle": false,
            "repeat": false,
            "crossfade": false
        },
        "roomName": "Bathroom",
        "coordinator": "",
        "groupState": {
            "volume": 15,
            "mute": false
        }
    },
    "members": [{
        "uuid": "",
        "state": {
            "currentTrack": {
                "artist": "",
                "title": "WCBS Newsradio 880",
                "album": "",
                "albumArtURI": "/getaa?s=1&u=x-sonosapi-stream%3as27760%3fsid%3d254%26flags%3d8224%26sn%3d0",
                "duration": 0,
                "uri": "x-sonosapi-stream:s27760?sid=254&flags=8224&sn=0",
                "radioShowMetaData": "",
                "absoluteAlbumArtURI": "http://192.168.1.51:1400/getaa?s=1&u=x-sonosapi-stream%3as27760%3fsid%3d254%26flags%3d8224%26sn%3d0",
                "streamInfo": "",
                "type": "radio"
            },
            "nextTrack": {
                "artist": "",
                "title": "",
                "album": "",
                "albumArtURI": "",
                "duration": 0,
                "uri": ""
            },
            "volume": 15,
            "mute": false,
            "trackNo": 1,
            "elapsedTime": 0,
            "elapsedTimeFormatted": "00:00",
            "zoneState": "STOPPED",
            "playerState": "STOPPED",
            "zonePlayMode": {
                "shuffle": false,
                "repeat": false,
                "crossfade": false
            }
        },
        "playMode": {
            "shuffle": false,
            "repeat": false,
            "crossfade": false
        },
        "roomName": "Bathroom",
        "coordinator": "",
        "groupState": {
            "volume": 15,
            "mute": false
        }
    }]
}, {
    "uuid": "",
    "coordinator": {
        "uuid": "",
        "state": {
            "currentTrack": {
                "artist": "Carrie Underwood",
                "title": "Before He Cheats",
                "album": "Some Hearts",
                "albumArtURI": "/getaa?s=1&u=x-sonosprog-http%3asong%253a214696369.mp4%3fsid%3d204%26flags%3d8224%26sn%3d1",
                "duration": 199,
                "uri": "x-sonosprog-http:song%3a214696369.mp4?sid=204&flags=8224&sn=1",
                "radioShowMetaData": "",
                "absoluteAlbumArtURI": "http://192.168.1.51:1400/getaa?s=1&u=x-sonosprog-http%3asong%253a214696369.mp4%3fsid%3d204%26flags%3d8224%26sn%3d1",
                "streamInfo": "",
                "type": "track"
            },
            "nextTrack": {
                "uri": "x-sonosprog-http:song%3a444901560.mp4?sid=204&flags=8224&sn=1",
                "albumArtURI": "/getaa?s=1&u=x-sonosprog-http%3asong%253a444901560.mp4%3fsid%3d204%26flags%3d8224%26sn%3d1",
                "absoluteAlbumArtURI": "http://192.168.1.51:1400/getaa?s=1&u=x-sonosprog-http%3asong%253a444901560.mp4%3fsid%3d204%26flags%3d8224%26sn%3d1",
                "title": "Love You Like a Love Song",
                "artist": "Selena Gomez & The Scene",
                "album": "When the Sun Goes Down"
            },
            "volume": 3,
            "mute": false,
            "trackNo": 3,
            "elapsedTime": 198,
            "elapsedTimeFormatted": "03:18",
            "zoneState": "PLAYING",
            "playerState": "PLAYING",
            "zonePlayMode": {
                "shuffle": false,
                "repeat": false,
                "crossfade": false
            }
        },
        "playMode": {
            "shuffle": false,
            "repeat": false,
            "crossfade": false
        },
        "roomName": "Portable",
        "coordinator": "",
        "groupState": {
            "volume": 3,
            "mute": false
        }
    },
    "members": [{
        "uuid": "",
        "state": {
            "currentTrack": {
                "artist": "Carrie Underwood",
                "title": "Before He Cheats",
                "album": "Some Hearts",
                "albumArtURI": "/getaa?s=1&u=x-sonosprog-http%3asong%253a214696369.mp4%3fsid%3d204%26flags%3d8224%26sn%3d1",
                "duration": 199,
                "uri": "x-sonosprog-http:song%3a214696369.mp4?sid=204&flags=8224&sn=1",
                "radioShowMetaData": "",
                "absoluteAlbumArtURI": "http://192.168.1.51:1400/getaa?s=1&u=x-sonosprog-http%3asong%253a214696369.mp4%3fsid%3d204%26flags%3d8224%26sn%3d1",
                "streamInfo": "",
                "type": "track"
            },
            "nextTrack": {
                "uri": "x-sonosprog-http:song%3a444901560.mp4?sid=204&flags=8224&sn=1",
                "albumArtURI": "/getaa?s=1&u=x-sonosprog-http%3asong%253a444901560.mp4%3fsid%3d204%26flags%3d8224%26sn%3d1",
                "absoluteAlbumArtURI": "http://192.168.1.51:1400/getaa?s=1&u=x-sonosprog-http%3asong%253a444901560.mp4%3fsid%3d204%26flags%3d8224%26sn%3d1",
                "title": "Love You Like a Love Song",
                "artist": "Selena Gomez & The Scene",
                "album": "When the Sun Goes Down"
            },
            "volume": 3,
            "mute": false,
            "trackNo": 3,
            "elapsedTime": 198,
            "elapsedTimeFormatted": "03:18",
            "zoneState": "PLAYING",
            "playerState": "PLAYING",
            "zonePlayMode": {
                "shuffle": false,
                "repeat": false,
                "crossfade": false
            }
        },
        "playMode": {
            "shuffle": false,
            "repeat": false,
            "crossfade": false
        },
        "roomName": "Portable",
        "coordinator": "",
        "groupState": {
            "volume": 3,
            "mute": false
        }
    }]
}, {
    "uuid": "",
    "coordinator": {
        "uuid": "",
        "state": {
            "currentTrack": {
                "artist": "",
                "title": " ",
                "album": "",
                "albumArtURI": "",
                "duration": 0,
                "uri": "x-sonos-htastream:RINCON_5CAAFD1AA48101400:spdif",
                "radioShowMetaData": "",
                "absoluteAlbumArtURI": "",
                "type": "track"
            },
            "nextTrack": {
                "artist": "",
                "title": "",
                "album": "",
                "albumArtURI": "",
                "duration": 0,
                "uri": ""
            },
            "volume": 34,
            "mute": false,
            "trackNo": 1,
            "elapsedTime": 413,
            "elapsedTimeFormatted": "06:53",
            "zoneState": "PLAYING",
            "playerState": "PLAYING",
            "zonePlayMode": {
                "shuffle": false,
                "repeat": false,
                "crossfade": false
            }
        },
        "playMode": {
            "shuffle": false,
            "repeat": false,
            "crossfade": false
        },
        "roomName": "Family Room",
        "coordinator": "",
        "groupState": {
            "volume": 34,
            "mute": false
        }
    },
    "members": [{
        "uuid": "",
        "state": {
            "currentTrack": {
                "artist": "",
                "title": " ",
                "album": "",
                "albumArtURI": "",
                "duration": 0,
                "uri": "x-sonos-htastream:RINCON_5CAAFD1AA48101400:spdif",
                "radioShowMetaData": "",
                "absoluteAlbumArtURI": "",
                "type": "track"
            },
            "nextTrack": {
                "artist": "",
                "title": "",
                "album": "",
                "albumArtURI": "",
                "duration": 0,
                "uri": ""
            },
            "volume": 34,
            "mute": false,
            "trackNo": 1,
            "elapsedTime": 413,
            "elapsedTimeFormatted": "06:53",
            "zoneState": "PLAYING",
            "playerState": "PLAYING",
            "zonePlayMode": {
                "shuffle": false,
                "repeat": false,
                "crossfade": false
            }
        },
        "playMode": {
            "shuffle": false,
            "repeat": false,
            "crossfade": false
        },
        "roomName": "Family Room",
        "coordinator": "",
        "groupState": {
            "volume": 34,
            "mute": false
        }
    }]
}]

I'll have a look at it.

PS: just edited your comment to add the formatting.

Please try it with this fix.

btw: how is the visualization with multiple speakers? I've just one.

Thanks. I will try this evening.

Multiple speakers works fine - the track info and thumbnails stack in the region they are assigned.

As an enhancement I would suggest the ability to add each individual speaker as a config item.

e.g. showSpeaker: "SpeakerName" (or array)

And then have multiple instances of the module in the config file so that you can have only certain speakers on the mirror.

Off topic from this, so I can break out in to an enhancement suggestion if you wish.

That works! Thanks.

BTW I'm dabbling in JS and will see if I can implement my enhancement suggestion above

@CommanderB - did you manage to hide/show specific speakers?