Read the statement by Michael Teeuw here.
MMM-Sonos - Display what is currently playing on your Sonos network
-
@tbouron said in MMM-Sonos - Display what is currently playing on your Sonos network:
I assume you are talking about the second line for
artist
andalbum
right? I already have sort of partial fix for that (not displaying the album ifnull
). I could do the same thing for theartist
. When you are using airplay, is the first line displayed correctly? What does it say? I unfortunately cannot know if something comes through airplay or not, it’s all unified through the Sonos library.I checked that more. And it looks if I share a song from iTunes via AirPlay, it provides all necessary information, so the data is correct. But if I use YouTube, then it is empty. Song name is just empty, and both singer and album names are displayed as (null).
That would be a bug in the underlying Sonos library. I just listening for events and display whatever comes from there.
That’s bad. :( As I can see, sometimes it just gets crazy. Shows me up instances of the same, when only one group plays. Looks like the library behind node-http-sonos-api required for another modules of the same type is more stable currently.
The Sonos library doesn’t give me this information unfortunately so that won’t be possible to do for now.
I believe it gives in fact. As I can see from Sonos module, its class SonosGroup contains Members. I believe it can be used to count number of members in the current group, and if there is more than one, not output the volume. Alternatively, I believe it should be possible to extract exact names of members from the Group to construct a more user-friendly custom name to use in metadata (i.e. not “Kitchen+2”, but “Kitchen, Corridor, Bathroom”).
-
@eliah I’ll see what I can do. But in the meantime, feel free to open issues and/or PRs on the GitHub repo for potential fixes
-
@tbouron: first of all, very noice module, chapeau! Now the inevitable nag: is there any means of reducing the font size (especially the track)? Any hint/idea appreciated!
-
@hweigel Thanks, that’s very much appreciated!
The module specifies classes for each element, like this one for the track so you can customise the font size via your
custom.css
-
Alright, so I took a deeper look and it turns out that my code to display groups had a bug which made devices reappear even though they were part of a group. That should be fixed now with version
1.2.0
.I also added a new config flag to display the group’s full name, see README.md
Regarding your comment @eliah on group volume, I disagree. The volume displayed is the global volume of group, which is exactly what the sonos app displays. Displaying volume of all members wouldn’t make sense here as this module doesn’t control the speakers (again, the sonos app does exactly this, it displays the group volume, then display individual speaker volume when, and only when, you change the volume)
That’s why I’m going to skip your request. However if you strongly feel it should be there, the code is open source on GitHub so feel free to fork the repo and implement it :)And finally, simply
git fetch origin && git pull origin master
withinMMM-Sonos
folder to update the module. Enjoy! -
I am not able to get the module on the screen it is just blank when i play music on my Sonos units. My error log looks as below:
Do anyone have an idea to what is wrong?
0|mm | at createError (/home/pi/MagicMirror/modules/MMM-Sonos/node_mod ules/axios/lib/core/createError.js:16:15)
0|mm | at settle (/home/pi/MagicMirror/modules/MMM-Sonos/node_modules/ axios/lib/core/settle.js:17:12)
0|mm | at IncomingMessage.handleStreamEnd (/home/pi/MagicMirror/module s/MMM-Sonos/node_modules/axios/lib/adapters/http.js:237:11)
0|mm | at IncomingMessage.emit (events.js:187:15)
0|mm | at endReadableNT (_stream_readable.js:1090:12)
0|mm | at process._tickCallback (internal/process/next_tick.js:63:19)
0|mm | [15:26:18.931] [ERROR] (node:1174) UnhandledPromiseRejectionWarnin g: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 26)
0|mm | [15:26:19.373] [ERROR] (node:1174) UnhandledPromiseRejectionWarnin g: Error: Request failed with status code 405
0|mm | at createError (/home/pi/MagicMirror/modules/MMM-Sonos/node_mod ules/axios/lib/core/createError.js:16:15)
0|mm | at settle (/home/pi/MagicMirror/modules/MMM-Sonos/node_modules/ axios/lib/core/settle.js:17:12)
0|mm | at IncomingMessage.handleStreamEnd (/home/pi/MagicMirror/module s/MMM-Sonos/node_modules/axios/lib/adapters/http.js:237:11)
0|mm | at IncomingMessage.emit (events.js:187:15)
0|mm | at endReadableNT (_stream_readable.js:1090:12)
0|mm | at process._tickCallback (internal/process/next_tick.js:63:19)
0|mm | [15:26:19.380] [ERROR] (node:1174) UnhandledPromiseRejectionWarnin g: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 31) -
@tbouron I totally understand your concept and I think you created a really cool and good looking MMM! However, the albumart would be a really nice addition. Is there really no chance of adding it to the module? Sorry for nagging :winking_face:
-
@PH1TCH I don’t want to have to support something that I don’t use so I’m afraid I’m going to decline.
However, seems you are lucky as someone created a fork that includes the album cover: https://github.com/armybean/MMM-Sonos
-
This post is deleted! -
Hello,
I install this module but i got this error :
0|mm | Failed to get groups: No device found. Retrying in 1 seconds ...
Did i made a mistake ?