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 8.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
      last edited by

      Hi @eliah, thanks for your comment!
      The module looking for groups regularly is by design: there is unfortunately no event when groups changes therefore they are pulled every 5 seconds. The listeners are set only when groups have changed.

      I checked on my mirror and cannot see a difference of CPU usage with or without the module enabled. How “bad” is the CPU hog on yours?

      1 Reply Last reply Reply Quote 0
      • E Offline
        eliah
        last edited by

        @tbouron,
        In my case it seems that the script always consider that groups have changed, but that’s not true in fact. The log is full of repeating lines like that:

        [14:18:03.026] [LOG]    Found new (or updated) group "Kitchen + 1" on host "x.x.x.34"
        [14:18:03.029] [LOG]    Registering listeners on group "Kitchen + 1" (host "x.x.x.34")
        [14:18:03.281] [LOG]    [Group Kitchen + 1 - x.x.x.34] Track changed to "Pokerface" by "The Baseballs"
        [14:18:03.289] [LOG]    [Group Kitchen + 1 - x.x.x.34] Play state change to "paused"
        [14:18:03.353] [LOG]    [Group Kitchen + 1 - x.x.x.34] Volume changed to "13"
        [14:18:03.361] [LOG]    [Group Kitchen + 1 - x.x.x.34] Group is unmuted
        [14:18:07.847] [LOG]    Found new (or updated) group "Bathroom" on host "x.x.x.39"
        [14:18:07.849] [LOG]    Registering listeners on group "Bathroom" (host "x.x.x.39")
        [14:18:07.852] [LOG]    Found new (or updated) group "Kids’ Room" on host "x.x.x.40"
        [14:18:07.854] [LOG]    Registering listeners on group "Kids’ Room" (host "x.x.x.40")
        [14:18:08.045] [LOG]    [Group Kids’ Room - x.x.x.40] Track changed to "Durch den Monsun" by "Annett Louisan"
        [14:18:08.053] [LOG]    [Group Kids’ Room - x.x.x.40] Play state change to "paused"
        [14:18:08.081] [LOG]    [Group Bathroom - x.x.x.39] Track changed to "Umbrella" by "The Baseballs"
        [14:18:08.088] [LOG]    [Group Bathroom - x.x.x.39] Play state change to "paused"
        [14:18:08.157] [LOG]    [Group Kids’ Room - x.x.x.40] Volume changed to "22"
        [14:18:08.163] [LOG]    [Group Kids’ Room - x.x.x.40] Group is unmuted
        [14:18:08.213] [LOG]    [Group Bathroom - x.x.x.39] Volume changed to "15"
        [14:18:08.216] [LOG]    [Group Bathroom - x.x.x.39] Group is unmuted
        [14:18:13.066] [LOG]    Found new (or updated) group "Kitchen + 1" on host "x.x.x.34"
        [14:18:13.069] [LOG]    Registering listeners on group "Kitchen + 1" (host "x.x.x.34")
        [14:18:13.507] [LOG]    [Group Kitchen + 1 - x.x.x.34] Track changed to "Pokerface" by "The Baseballs"
        [14:18:13.514] [LOG]    [Group Kitchen + 1 - x.x.x.34] Play state change to "paused"
        [14:18:13.593] [LOG]    [Group Kitchen + 1 - x.x.x.34] Volume changed to "13"
        [14:18:13.597] [LOG]    [Group Kitchen + 1 - x.x.x.34] Group is unmuted
        [14:18:18.029] [LOG]    Found new (or updated) group "Kids’ Room" on host "x.x.x.40"
        [14:18:18.032] [LOG]    Registering listeners on group "Kids’ Room" (host "x.x.x.40")
        [14:18:18.036] [LOG]    Found new (or updated) group "Bathroom" on host "x.x.x.39"
        [14:18:18.040] [LOG]    Registering listeners on group "Bathroom" (host "x.x.x.39")
        [14:18:18.277] [LOG]    [Group Kids’ Room - x.x.x.40] Track changed to "Durch den Monsun" by "Annett Louisan"
        [14:18:18.285] [LOG]    [Group Kids’ Room - x.x.x.40] Play state change to "paused"
        [14:18:18.309] [LOG]    [Group Bathroom - x.x.x.39] Track changed to "Umbrella" by "The Baseballs"
        [14:18:18.318] [LOG]    [Group Bathroom - x.x.x.39] Play state change to "paused"
        [14:18:18.408] [LOG]    [Group Kids’ Room - x.x.x.40] Volume changed to "22"
        [14:18:18.414] [LOG]    [Group Kids’ Room - x.x.x.40] Group is unmuted
        [14:18:18.434] [LOG]    [Group Bathroom - x.x.x.39] Volume changed to "15"
        [14:18:18.437] [LOG]    [Group Bathroom - x.x.x.39] Group is unmuted
        [14:18:23.059] [LOG]    Found new (or updated) group "Kitchen + 1" on host "x.x.x.34"
        [14:18:23.063] [LOG]    Registering listeners on group "Kitchen + 1" (host "x.x.x.34")
        [14:18:23.248] [LOG]    [Group Kitchen + 1 - x.x.x.34] Track changed to "Pokerface" by "The Baseballs"
        [14:18:23.255] [LOG]    [Group Kitchen + 1 - x.x.x.34] Play state change to "paused"
        [14:18:23.353] [LOG]    [Group Kitchen + 1 - x.x.x.34] Volume changed to "13"
        [14:18:23.359] [LOG]    [Group Kitchen + 1 - x.x.x.34] Group is unmuted
        [14:18:27.955] [LOG]    Found new (or updated) group "Kids’ Room" on host "x.x.x.40"
        [14:18:27.959] [LOG]    Registering listeners on group "Kids’ Room" (host "x.x.x.40")
        [14:18:27.965] [LOG]    Found new (or updated) group "Bathroom" on host "x.x.x.39"
        [14:18:27.969] [LOG]    Registering listeners on group "Bathroom" (host "x.x.x.39")
        [14:18:28.311] [LOG]    [Group Kids’ Room - x.x.x.40] Track changed to "Durch den Monsun" by "Annett Louisan"
        [14:18:28.316] [LOG]    [Group Kids’ Room - x.x.x.40] Play state change to "paused"
        [14:18:28.343] [LOG]    [Group Bathroom - x.x.x.39] Track changed to "Umbrella" by "The Baseballs"
        [14:18:28.351] [LOG]    [Group Bathroom - x.x.x.39] Play state change to "paused"
        [14:18:28.430] [LOG]    [Group Kids’ Room - x.x.x.40] Volume changed to "22"
        [14:18:28.434] [LOG]    [Group Kids’ Room - x.x.x.40] Group is unmuted
        [14:18:28.471] [LOG]    [Group Bathroom - x.x.x.39] Volume changed to "15"
        [14:18:28.474] [LOG]    [Group Bathroom - x.x.x.39] Group is unmuted
        
        

        And as I said before, actually all speakers are paused so nothing is really playing.

        T 1 Reply Last reply Reply Quote 0
        • T Offline
          tbouron Module Developer @eliah
          last edited by

          @eliah That’s interesting, it would suggest that the group IDs are not consistent (as groups are cached by IDs) which obviously shouldn’t happen. I’m also wondering if targeting a random device on every scan has any implications on this (but it shouldn’t, at least I cannot reproduce this on my own network)

          Would it possible for you to test a different version? I would like to see how it can be mitigated.

          1 Reply Last reply Reply Quote 0
          • E Offline
            eliah
            last edited by

            sure, I can test if you have any ideas why it is happening.

            T 1 Reply Last reply Reply Quote 0
            • T Offline
              tbouron Module Developer @eliah
              last edited by

              Hi @eliah. Can you try the version on the branch fix/group-scan and tell me how it goes ?

              You would just need to go into the MMM-Sonos folder and do:

              git fetch && git checkout fix/group-scan
              

              Thanks :)

              E 1 Reply Last reply Reply Quote 0
              • J Offline
                Jas
                last edited by

                @tbouron Beautiful module. How can I get the album art and Rooms that are stopped to also show up? What other info can I display?

                Thanks

                T 1 Reply Last reply Reply Quote 0
                • T Offline
                  tbouron Module Developer @Jas
                  last edited by tbouron

                  Hi @Jas and thanks!

                  Both of these are not supported. The concept of the module was to have a Sonos now playing... module with minimalist design hence:

                  • only vital information: title, artist, album (can be toggled), metadata: room, volume and track length (can be toggled)
                  • no album artwork
                  • show only rooms where music is playing, otherwise show nothing to avoid clutter

                  It would not be too hard to do all the above, but I don’t plan to do it anytime soon because of the concept.

                  J P 2 Replies Last reply Reply Quote 0
                  • J Offline
                    Jas @tbouron
                    last edited by

                    @tbouron Got it! Thank you for the quick response. Looks great!

                    T 1 Reply Last reply Reply Quote 0
                    • T Offline
                      tbouron Module Developer @Jas
                      last edited by

                      @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

                        @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 Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 1 / 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