• 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-SpotifyControl . Control your Spotify music player using Mk2 assistant.

Scheduled Pinned Locked Moved Entertainment
38 Posts 4 Posters 15.7k 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.
  • E Offline
    ejay-ibm Project Sponsor Module Developer
    last edited by ejay-ibm Mar 13, 2019, 9:27 PM Mar 13, 2019, 2:43 PM

    Description

    A module to control spotify command : Play / Pause / Resume/ Next using Mk2assistant hook .

    This Module allow to control Spotify player on your Mirror.
    For now you can only control a single device.
    It could be your mirror if you are running Raspotify on it.

    Special thanks to @mantha who bring this idea and the base code to me.
    Big Thanks to @Sean who helped me in the module development and spent a lot of time to teach me some dev concept.

    Please bear in mind: I’m not a developer and the module might still contain issues.
    I’ll try my best to fix them but if any dev wants to help me in that task or want to help me improve this module you are more than welcome!

    Enjoy

    Ejay

    Download

    [card:ejay-ibm/MMM-SpotifyControl]

    W 1 Reply Last reply Mar 13, 2019, 8:08 PM Reply Quote 1
    • W Offline
      wishmaster270 Module Developer @ejay-ibm
      last edited by Mar 13, 2019, 8:08 PM

      @ejay-ibm you are a genius and saved me a lot of time.
      I had the same idea but no time to implement it.
      Thank you very mich

      E 1 Reply Last reply Mar 13, 2019, 8:26 PM Reply Quote 0
      • E Offline
        ejay-ibm Project Sponsor Module Developer @wishmaster270
        last edited by Mar 13, 2019, 8:26 PM

        @wishmaster270 Thank you let me know your feedback once tested !

        1 Reply Last reply Reply Quote 0
        • F Offline
          F17MC
          last edited by F17MC Mar 14, 2019, 12:19 AM Mar 13, 2019, 10:59 PM

          Awesome! I have installed it and it works, but… I have a problem with MMM-AssistantMk2 + your module.

          MMM-AssistantMk2 is working. I say: Smartmirror, play music on Spotify (my command). And it works.

          But, later, if I want to say something to MMM-AssistantMk2, I can’t.

          It’s my log:

          [HOTWORD] stops listening
          Speaker error: 1
          Whoops! There was an uncaught exception...
          1
          MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
          If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
          

          Maybe the problem is that if the speakers are using by other “process”, MMM-AssistantMk2 have a problem to use?
          Anyway, it is perfect . I’m testing…

          1 Reply Last reply Reply Quote 1
          • E Offline
            ejay-ibm Project Sponsor Module Developer
            last edited by ejay-ibm Mar 14, 2019, 6:50 AM Mar 14, 2019, 6:43 AM

            Hi,

            I do not think this is an issue with the speaker.
            Could you please send the full logs from start to end ?
            Are you using pm2 ? If yes please send me error and out log. ( delete them first before restarting your mirror )
            just do pm2 show to know where they are .
            As well while you reproduce check the developer console ( Ctrl + i ) on the mirror and send me the content .

            Just reproduce the case as follow : Start Mirror , request a song, make a new request to the assistant . Quit . and send me the logs. please add as well you config.js file . You can put all in a single zip file.

            I’ll update the git. please post everything here.

            Thank you

            Ejay

            1 Reply Last reply Reply Quote 0
            • C Offline
              Cr4z33
              last edited by Mar 14, 2019, 11:56 AM

              Can someone that is NOT a Spotify Premium user please confirm whether this module works for him too or not?

              My (mirror) Google Assistant is not understanding what I want to do and I want to be sure it has nothing to do with this module.

              E 1 Reply Last reply Mar 14, 2019, 12:18 PM Reply Quote 0
              • E Offline
                ejay-ibm Project Sponsor Module Developer @Cr4z33
                last edited by Mar 14, 2019, 12:18 PM

                @Cr4z33 from here :
                https://developer.spotify.com/documentation/web-api/quick-start/
                “To use the Web API, start by creating a Spotify user account (Premium or Free).”

                Note :
                Spotify Free is supported by ads.
                Every few tracks you play, you will be forced to be interrupted by one or two short adverts, which will also break your pleasure that you get from the music.
                Some tracks are not be playable. You can use the desktop and web interfaces, but the mobile app will only let you listen on shuffle mode or pre-made playlists.

                with your free account : what does it do when you say “bob marley on spotify” ?

                Ejay

                C 1 Reply Last reply Mar 14, 2019, 1:30 PM Reply Quote 0
                • C Offline
                  Cr4z33 @ejay-ibm
                  last edited by Cr4z33 Mar 14, 2019, 1:31 PM Mar 14, 2019, 1:30 PM

                  @ejay-ibm said in MMM-SpotifyControl . Control your Spotify music player using Mk2 assistant.:

                  with your free account : what does it do when you say “bob marley on spotify” ?

                  Well considering that my (mirror) Google Assistant is set to Italian language it simply replies saying it doesn’t know what I want to do.

                  On the other hand if I say (in Italian) ‘Hey Google play music on Spotify’ on my living room’s Google Home Mini it works flawlessly.

                  Actually tell me how is your module supposed to accept that command if we only entered PREV_SONG, PAUSE_SPOTIFY, RESUME_SPOTIFY and PLAY_NEXT_SPOTIFY?
                  I mean I see no PLAY command there? :smiling_face_with_open_mouth_cold_sweat:

                  Also aren’t these transcriptionHook entries supposed to be entered into quotation marks?
                  I ask because I’ve got other entries there and they are ALL into quotation marks.

                  E 1 Reply Last reply Mar 14, 2019, 1:39 PM Reply Quote 0
                  • E Offline
                    ejay-ibm Project Sponsor Module Developer @Cr4z33
                    last edited by ejay-ibm Mar 14, 2019, 2:17 PM Mar 14, 2019, 1:39 PM

                    @Cr4z33
                    Ok I got your point Google assisant and sdk act differently .

                    What happen when you say something to your assisant:
                    “Play bob marley on spotify”
                    It search like you would do in the google search bar
                    and return a result.
                    That is your payload for the play … spotify command.
                    Note that this command is the only one to not have a hook .

                    So what it does is returning the first result from a google search .

                    if I type “bob marley spotify” in my search bar i’m getting :
                    Bob Marley & The Wailers on Spotify
                    https://open.spotify.com/artist/2QsynagSdAqZj3U9HgDzjD

                    That is what is expected from the payload , as we build later the api call from this url .

                    I would try first to google search for "an artist on spotify in italian’ and see what it return they say to your assisant in italian the same. Usually the assistant quickly display what it find from the search you should see an url like :
                    https://open.spotify.com/(artist, track or playlist)/with an Id here .

                    regarding the syntax Quote or double quote doesn’t matter in js.

                    Both

                     transcriptionHook: {
                            PREV_SONG: {
                               pattern: "previous song",   
                               command: "PREV_SONG"
                          },
                    or 
                    transcriptionHook: {
                            PREV_SONG: {
                               pattern: 'previous song',   
                               command: 'PREV_SONG'
                          },
                    
                    

                    will work the same.

                    Hope this helps

                    Ejay

                    C 1 Reply Last reply Mar 14, 2019, 2:14 PM Reply Quote 0
                    • C Offline
                      Cr4z33 @ejay-ibm
                      last edited by Mar 14, 2019, 2:14 PM

                      @ejay-ibm said in MMM-SpotifyControl . Control your Spotify music player using Mk2 assistant.:

                      @Cr4z33
                      Both
                      transcriptionHook: {
                      PREV_SONG: {
                      pattern: “previous song”,
                      command: “PREV_SONG”
                      },
                      or
                      transcriptionHook: {
                      PREV_SONG: {
                      pattern: ‘previous song’,
                      command: ‘PREV_SONG’
                      },

                      will work the same.

                      Hope this helps

                      Ejay

                      Sorry you misunderstood me. :smiling_face_with_open_mouth_cold_sweat:

                      What I meant is don’t we have to put ie. PREV_SONG into quotation marks like

                      "PREV_SONG": {
                      

                      ?

                      As for the Google Assistant test you are asking me are you referring to the mirror module or to my Google Home Mini device?

                      E 1 Reply Last reply Mar 14, 2019, 2:16 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 1 / 4
                      1 / 4
                      • First post
                        4/38
                        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