• 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.

Spotify Play?

Scheduled Pinned Locked Moved Bug Hunt
19 Posts 6 Posters 13.8k Views 12 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.
  • Y Offline
    yawns Moderator @Rasmus rytter
    last edited by Jan 2, 2019, 12:58 PM

    @rasmus-rytter said in Spotify Play?:

    Thanks @richland007
    so i need raspotify to start the music though the mirror?

    Yes, you need it. https://github.com/dtcooper/raspotify
    And still you need something else (smartphone, tablet, computer/laptop) to control the playback. All you do is connect the “control device” to the same network as your mirror, start spotify, look for other playback devices and select your mirror instead. Then - in theory - playback should run on your mirror.
    I used spotify-connect-web and MMM-SpotifyConnectUI, but I haven’t been playing around with my mirror installation for almost a year, so I am not sure if this still works. Biggest issue was getting the spotify appkey after registering as a developer. Looks like you don’t have to worry about this with the newer raspotify

    R 1 Reply Last reply Jan 2, 2019, 1:01 PM Reply Quote 0
    • R Offline
      Rasmus rytter @yawns
      last edited by Jan 2, 2019, 1:01 PM

      Hey @yawns,
      Okay that makes sense. I have just wondered if i could play the music with my google assistant from MMM-AssistantMk2 but i guess not, Tanks :)

      M 1 Reply Last reply Jan 25, 2019, 5:37 AM Reply Quote 0
      • M Offline
        mantha @Rasmus rytter
        last edited by Jan 25, 2019, 5:37 AM

        Hi @rasmus-rytter,

        if two or more people came to the same conclusion, its an indication that its not an to bad idea :-)
        independent from this post i just had setup my mirror exactly the way @yawns and @richland007 described to you.

        I enhanced MMM-NowPlayingOnSpotify and MMM-AssistantMk2 to make them capable to control Spotify. It´s still in development but if you like you can have a look on my git forks.

        MMM-NowPlayingOnSpotify
        MMM-AssistantMk2

        you need to redo your authorization (Step 2) because we require now also the authorization user-modify-playback-state and you should add “deviceName” into your config-file.

        Im looking forward to your feedback dear alpha-tester ;-)

        F 1 Reply Last reply Mar 6, 2019, 8:26 PM Reply Quote 1
        • F Offline
          F17MC @mantha
          last edited by Mar 6, 2019, 8:26 PM

          @mantha Hi! How can I install this feature?
          I want launch Spotify with my MagicMirror. I have installed NowPlayingOnSpotify, AssistantMK2 and Raspotify. All works fine.
          Now, I can do the next: If I said to AssistantMK2 “SmartMirror, play Spotify on Chromecast Audio”, it launch raspotify and select my ChromeCast Audio as output. Do you think that it is possible?

          Sorry for my English.

          1 Reply Last reply Reply Quote 0
          • E Offline
            ejay-ibm Project Sponsor Module Developer
            last edited by ejay-ibm Mar 7, 2019, 3:57 PM Mar 7, 2019, 3:47 PM

            @mantha Thank you for working on this !

            I have installed you modules.

            Unfortunately I can’t make the player respond to my play / stop command .
            the player well respond when I select a song from my phone and send it to raspotify , the module is well updated with cover and paying status .

            But voice command just doesn’t work .

            Anything particular I should say ?
            Maybe your developement is just done 100% done yet.

            Thank you

            Ejay

            M 1 Reply Last reply Mar 7, 2019, 5:13 PM Reply Quote 0
            • M Offline
              mantha @ejay-ibm
              last edited by Mar 7, 2019, 5:13 PM

              @ejay-ibm
              the module is listening to an open.spotify.com answer from Google assistant.
              It seems like the assistant is not aware of the preconfigured music provider and you need to point him in the right direction.

              “search for xxx on Spotify” works in my case. I’m almost sure that in the past also “play xxx from spotify” had worked, but now I got no more an open.spotify.com link backs. Would be interesting how it works for you.

              FYI - I identified that the Device parameter does not work proper in the current github version. need to work on this…

              1 Reply Last reply Reply Quote 0
              • E Offline
                ejay-ibm Project Sponsor Module Developer
                last edited by Mar 7, 2019, 6:03 PM

                Ok I see the answer coming to the screen but it look like it’s not passed to the module.

                "Micheal Jackson on spotify" ((open.spotify.com -- https://open.spotify.com/artist/3fMbdgg4jU18AjLCKBhRSm))\nMichael Jackson wasn't merely the biggest pop .... 
                

                Let me know if you need me to run some test or report logs to help you in debug.

                Ejay

                M 1 Reply Last reply Mar 7, 2019, 8:45 PM Reply Quote 0
                • M Offline
                  mantha @ejay-ibm
                  last edited by Mar 7, 2019, 8:45 PM

                  @ejay-ibm
                  in a first step you could check the console log for “[AMK2] openSpotify found:” and if the event PLAY_SPOTIFY was fired…

                  E 1 Reply Last reply Mar 7, 2019, 10:54 PM Reply Quote 0
                  • E Offline
                    ejay-ibm Project Sponsor Module Developer @mantha
                    last edited by ejay-ibm Mar 7, 2019, 11:13 PM Mar 7, 2019, 10:54 PM

                    @mantha none of both found .
                    could you point me to the line in your code sending this to the console log please ?
                    I see in MK2 js code

                    if (payload.foundOpenSpotify) {
                    		this.sendNotification("PLAY_SPOTIFY", {
                    			url: payload.foundOpenSpotify
                    		})
                        };
                    

                    I can say that the notification is not sent, so no payload.foundOpenSpotify occur

                    I can see as well in node_helper.js

                    if (openSpotify) {
                              console.error("[AMK2] openSpotify found:", openSpotify[1])
                              foundOpenSpotify = openSpotify[1]
                            }
                          })
                    

                    Why in console error instead of console log ?
                    ( Sorry i’m not a dev might be a silly question and I guess the result would be the same if log or error it should be sent to the console… )

                    M 1 Reply Last reply Mar 8, 2019, 8:19 AM Reply Quote 0
                    • E Offline
                      ejay-ibm Project Sponsor Module Developer
                      last edited by ejay-ibm Mar 7, 2019, 11:47 PM Mar 7, 2019, 11:08 PM

                      As well I think the regex is not correct here : node_helper.js line 290

                      var re = new RegExp("\\(.open\\.spotify\\.com – (https:\\/\\/open\\.spotify\\.com[^ ]*).\\)", "gm")
                      

                      should be :

                      var re = new RegExp("\(open\.spotify\.com – (https:\/\/open\.spotify\.com[^ ]*\/\)", "gm")
                      
                      open\.spotify\.com
                      

                      is the correct regex to match with :
                      open.spotify.com
                      and

                      https:\/\/open\.spotify\.com[^ ]*\/
                      

                      is the correct regex to match with :
                      https://open.spotify.com/fallback1234

                      I may be wrong in my interpretation.

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      • 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