• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-Sonos - Display what is currently playing on your Sonos network

Scheduled Pinned Locked Moved Entertainment
25 Posts 8 Posters 5.8k Views 9 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    tbouron Module Developer @Jas
    last edited by Jan 7, 2020, 3:19 PM

    @Jas No problem. Feel free to add an issue on GitHub. If enough people really want it and +1 the issue, I’ll consider doing it ;)

    1 Reply Last reply Reply Quote 0
    • E Offline
      eliah @tbouron
      last edited by Jan 8, 2020, 3:18 PM

      @tbouron It looks like the issue is now fixed, no constant updates anymore! Thank you. :)
      Some more issues I noticed:

      1. Value for song length minutes has no leading zero, so when a song’s length is 2:04 it shows 2:4.
      2. If any of speakers are used directly by AirPlay, it shows (null) (null). Maybe it’s better to ignore AirPlay mode if no information is available for it?
      3. Not sure if it is a bug of a module or Sonos library behind it, but for some reason the group names are sometimes become incorrect. For example, if I start a playlist on three speakers in the same group, first it shows something like “Kitchen+2” (and that’s correct), but after some time it becomes just “Kitchen” (same 3 speakers are playing).
        And additionally, if more than one speaker is playing in the same group, each of them can have its own volume. In this case the single volume indicator that your module outputs to the screen becomes useless.
      T 1 Reply Last reply Jan 8, 2020, 4:27 PM Reply Quote 0
      • T Offline
        tbouron Module Developer @eliah
        last edited by tbouron Jan 8, 2020, 4:30 PM Jan 8, 2020, 4:27 PM

        @eliah Awesome! Thanks for the feedback, I’ll cleanup and push the changes as soon as possible :)

        Regarding the other issues:

        Value for song length minutes has no leading zero, so when a song’s length is 2:04 it shows 2:4.

        I already fixed that, it’s in a branch since Christmas but I was waiting for your feedback on the group scan issue to release it.

        any of speakers are used directly by AirPlay, it shows (null) (null). Maybe it’s better to ignore AirPlay mode if no information is available for it?

        I assume you are talking about the second line for artist and album right? I already have sort of partial fix for that (not displaying the album if null). I could do the same thing for the artist. 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.

        Not sure if it is a bug of a module or Sonos library behind it, but for some reason the group names are sometimes become incorrect. For example, if I start a playlist on three speakers in the same group, first it shows something like “Kitchen+2” (and that’s correct), but after some time it becomes just “Kitchen” (same 3 speakers are playing).

        That would be a bug in the underlying Sonos library. I just listening for events and display whatever comes from there.

        And additionally, if more than one speaker is playing in the same group, each of them can have its own volume. In this case the single volume indicator that your module outputs to the screen becomes useless.

        The Sonos library doesn’t give me this information unfortunately so that won’t be possible to do for now.

        E 1 Reply Last reply Jan 11, 2020, 7:53 PM Reply Quote 0
        • E Offline
          eliah @tbouron
          last edited by Jan 11, 2020, 7:53 PM

          @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 and album right? I already have sort of partial fix for that (not displaying the album if null). I could do the same thing for the artist. 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”).

          T 1 Reply Last reply Jan 11, 2020, 8:48 PM Reply Quote 0
          • T Offline
            tbouron Module Developer @eliah
            last edited by tbouron Jan 25, 2020, 11:17 AM Jan 11, 2020, 8:48 PM

            @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

            1 Reply Last reply Reply Quote 0
            • H Offline
              hweigel
              last edited by Jan 14, 2020, 10:15 PM

              @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!

              T 1 Reply Last reply Jan 14, 2020, 11:57 PM Reply Quote 0
              • T Offline
                tbouron Module Developer @hweigel
                last edited by Jan 14, 2020, 11:57 PM

                @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

                1 Reply Last reply Reply Quote 1
                • T Offline
                  tbouron Module Developer
                  last edited by Jan 25, 2020, 9:38 AM

                  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 within MMM-Sonos folder to update the module. Enjoy!

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thchristensendk
                    last edited by Mar 12, 2020, 2:38 PM

                    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)

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      PH1TCH @tbouron
                      last edited by May 28, 2020, 8:55 PM

                      @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:

                      S 1 Reply Last reply May 29, 2020, 6:46 AM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 2 / 3
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy