• 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
  1. Home
  2. ejay-ibm
  3. Posts
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Offline
  • Profile
  • Following 0
  • Followers 1
  • Topics 7
  • Posts 94
  • Groups 2

Posts

Recent Best Controversial
  • RE: Spotify Play?

    Ok I made a few changes in the MK2assistant node-helper.js

    var re = new RegExp("https:\/\/open\.spotify\.com\/([a-zA-Z0-9?\/]+)", "gm")
            //var re = new RegExp("\\(.open\\.spotify\\.com – (https:\\/\\/open\\.spotify\\.com[^ ]*).\\)", "gm")
            var openSpotify = re.exec(str)
            if (openSpotify) {
            console.error("[AMK2] openSpotify found:", openSpotify[0])
              foundOpenSpotify = openSpotify[0]
            
    

    And as well in Nowplayingoncpotify/core/Spotifyconnector.js

    let uri = replaceall("/", ":", url.replace("https:\/\/open.spotify.com", "spotify"));
    

    The slash were not escaped in the url making half of the line be a comment.

    After updating raspotify to the latest I can say : “Michael Jackson on spotify” and the song start playing .
    Good stuff .

    I’m wondering if slash should be escaped as well here I haven’t do it since it’s working :

    const tokenRefreshEndpoint = 'https://accounts.spotify.com/api/token';
    const apiEndpoint = 'https://api.spotify.com/v1/me/player';
    

    As you can see the editor consider the part after the slash as comment

    0_1552119557018_Capture d’écran 2019-03-09 à 09.18.38.png
    Not sure how it works on interpretor side.

    anyway I’ll post my update in the repo .

    Ejay

    posted in Bug Hunt
    E
    ejay-ibm
    Mar 9, 2019, 8:12 AM
  • RE: MMM-Assistantmk2 and MMM-Hotword not picking up

    Hi,

    1- I would say first to check you CPU charge first , the delay might be due to the load.
    2- just say " Jarvis" … " Micheal jackson smooth criminal" it will play the youtube video clip
    3- if you want to say " ok google" you have to add your own umdl or umdp file.

    Info and new umd* file can be found and created here :
    https://snowboy.kitt.ai/

    hope this help .

    Ejay

    posted in Troubleshooting
    E
    ejay-ibm
    Mar 8, 2019, 2:09 PM
  • RE: Spotify Play?

    @mantha
    Sorry typo it well respond with

    open.spotify.com - https...
    

    I have try :

     var re = new RegExp("https:\/\/open\.spotify\.com\/([^ ]*)", "gm")
            var openSpotify = re.exec(str)
            if (openSpotify) {
              console.error("[AMK2] openSpotify found:", openSpotify[1])
              foundOpenSpotify = openSpotify[1]
    

    And I’m getting in console log :

    received a module notification: PLAY_SPOTIFY from sender: MMM-AssistantMk2

    but

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

    I’m not getting anything.

    What is strange is that in both case :
    console.error(“[AMK2] openSpotify found:”, openSpotify[1])

    Doesn’t throw anything…
    but as well
    console.log(“[AMK2] video found:”, youtubeVideo[1])
    Doesn’t throw anything either even when it find and play a video. so i’ll not worry for not about the notif logs

    So, for Now, I consider it’s working as PLAY_SPOTIFY notification is fired.

    What would be the next step now?

    Ejay

    posted in Bug Hunt
    E
    ejay-ibm
    Mar 8, 2019, 9:40 AM
  • RE: Spotify Play?

    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.

    posted in Bug Hunt
    E
    ejay-ibm
    Mar 7, 2019, 11:08 PM
  • RE: Spotify Play?

    @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… )

    posted in Bug Hunt
    E
    ejay-ibm
    Mar 7, 2019, 10:54 PM
  • RE: Spotify Play?

    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

    posted in Bug Hunt
    E
    ejay-ibm
    Mar 7, 2019, 6:03 PM
  • RE: Spotify Play?

    @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

    posted in Bug Hunt
    E
    ejay-ibm
    Mar 7, 2019, 3:47 PM
  • RE: MMM-AI

    If you have any idea on standby/talk animation I can create for this module feel free to propose them !
    I’m planning to make an ‘HAL’ one
    based on this image :
    0_1551897653917_merlin_135847308_098289a6-90ee-461b-88e2-20920469f96a-articleLarge.jpg

    Ejay

    posted in Fun & Games
    E
    ejay-ibm
    Mar 6, 2019, 6:41 PM
  • MMM-AI

    Hello guys,

    This is my first module !
    Well I give most of the credit to @sean who created the code as i’m not a dev at all .

    What I did is taking MMM-TriggerNotification and MMM-HTMLBox, and merge those 2 modules in one to create mine based on the idea I had.

    https://github.com/ejay-ibm/MMM-AI

    MMM-AI

    MMM-AI is a simple module based on a mix of MMM-NotificationTrigger & MMM-HTMLBOX from eouia that allow to have animation of ‘AI’ kind when the assistant ( Alexa / MMM-Mk2assistant ) is in standby mode ( waiting for user instruction) or talking mode ( when assistant is replying ) triggered by Notification sent by these modules.

    Screenshot

        Standby animation                     Talking animation
    

    0_1551885191851_b8619853-b0eb-48ed-abbb-4f2d2ec7aca0-image.png

    Full gif here :
    https://github.com/ejay-ibm/MMM-AI/blob/master/jarvis-standby2.gif
    https://github.com/ejay-ibm/MMM-AI/blob/master/jarvis-talk2.gif

    alt text

    Installation

    In the MagicMirror/modules directory run :

    git clone https://github.com/ejay-ibm/MMM-AI.git
    

    Configuration Sample

    {
          module: "MMM-AI",
          position: "top_center",
          config: {
            width: "300px",
            height: "300px",
            refresh_interval_sec: 0, // you should not refresh, because content will be back to default value.
            content: `<img id="MY_ANIMATION" src="modules/MMM-AI/jarvis-standby2.gif"/>`,
            triggers: [
              {
                trigger: "HOTWORD_RESUME", // HOTWORD_LISTENING if you use MMM-HOTWORD  or HOTWORD_RESUME if you use MMM-AssistantMk2
                fires: [
                  {
                    fire: "standby_Image",
                    payload: payload => {
                      var img = document.getElementById("MY_ANIMATION");
                      img.src = "modules/MMM-AI/jarvis-standby2.gif";
                      return payload;
                    }
                  }
                ]
              },
    		{
                trigger: "ASSISTANT_UNDERSTOOD", // HOTWORD_SLEEPING if you use MMM-HOTWORD  or HOTWORD_PAUSE if you use MMM-AssistantMk2
                fires: [
                  {
                    fire: "Talk_Image",
                    payload: payload => {
                      var img = document.getElementById("MY_ANIMATION");
                      img.src = "modules/MMM-AI/jarvis-talk2.gif";
                      return payload;
                    }
                  }
                ]
              }
            ]
          }
        },
    
    

    Additional Info

    please make sure you are up to date on the Mk2 assistant module for this module to work as expected
    All other configuration sample from https://github.com/eouia/MMM-HTMLBOX & https://github.com/eouia/MMM-NotificationTrigger are applicable to this module.

    Thanks again to Sean : https://github.com/eouia/ who have created this code that I have merged for this module purpose.
    Animated images are created by me using crazy talk and Photoshop I will work to create additional ones.

    posted in Fun & Games
    E
    ejay-ibm
    Mar 6, 2019, 3:08 PM
  • RE: MMM-Assistantmk2 and MMM-Hotword not picking up

    install audacity and give a quick test to your mic.
    you will know if you mic is dead

    sudo apt-get install audacity

    posted in Troubleshooting
    E
    ejay-ibm
    Mar 6, 2019, 10:57 AM
  • 1 / 1
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