• 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.9k 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 Dec 24, 2019, 12:01 PM

    Hi there.

    I realised there is already a couple of modules for Sonos, but they didn’t really worked for me. I wanted something more minimalist, and easier to install: all sonos modules right now require to install and run a proxy sonos API server along side MagicMirror. My module doesn’t: clone it, install it and there you go!

    All necessary information (configuration, screenshot) is available on the GitHub repository: https://github.com/tbouron/MMM-Sonos

    Hope you’ll enjoy!

    0_1577188815998_screenshot.png

    1 Reply Last reply Reply Quote 0
    • E Offline
      eliah
      last edited by Jan 2, 2020, 11:35 AM

      Hi @tbouron,
      Great idea to simplify SONOS integration installation!
      Your module works for me, and I like that it updates the data almost instantly comparing to other modules that do it on schedule.
      But in my case your module constantly thinks that something have updated in SONOS groups, even if nothing is currently being played. So it constantly updates the groups, sets listener, causing high CPU utilization by Electron.

      1 Reply Last reply Reply Quote 0
      • T Offline
        tbouron Module Developer
        last edited by Jan 2, 2020, 6:02 PM

        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 Jan 2, 2020, 7:38 PM

          @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 Jan 2, 2020, 8:43 PM Reply Quote 0
          • T Offline
            tbouron Module Developer @eliah
            last edited by Jan 2, 2020, 8:43 PM

            @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 Jan 3, 2020, 5:41 PM

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

              T 1 Reply Last reply Jan 5, 2020, 10:49 AM Reply Quote 0
              • T Offline
                tbouron Module Developer @eliah
                last edited by Jan 5, 2020, 10:49 AM

                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 Jan 8, 2020, 3:18 PM Reply Quote 0
                • J Offline
                  Jas
                  last edited by Jan 7, 2020, 2:54 PM

                  @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 Jan 7, 2020, 3:08 PM Reply Quote 0
                  • T Offline
                    tbouron Module Developer @Jas
                    last edited by tbouron Jan 7, 2020, 3:09 PM Jan 7, 2020, 3:08 PM

                    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 Jan 7, 2020, 3:17 PM Reply Quote 0
                    • J Offline
                      Jas @tbouron
                      last edited by Jan 7, 2020, 3:17 PM

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

                      T 1 Reply Last reply Jan 7, 2020, 3:19 PM 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