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.

    Help I need the MMM-MplayerRadio recipe for GA

    Scheduled Pinned Locked Moved Entertainment
    15 Posts 5 Posters 3.8k Views 4 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.
    • N Offline
      negrito Project Sponsor @swvalenti
      last edited by negrito

      @swvalenti

      I’ve been busy making something like that, using the recipe.template.js. But I’m not a programmer. This is what I made. The MMM-MPlayerRadio module works fine with controls from the screen, but I want to call it with GA. for example: Jarvis “play radio latina”, Jarvis…“play next”, Jarvis…“stop radio”, Jarvis…“previous radio”. Put the recipe in the GA recipe folder and added it to the config.js at GA recipe. But I need help with this? :downcast_face_with_sweat:

      /**  GoogleAssistant for MMM-MplayerRadio  **/
      /**  recipe.template.js  **/
      /**  @negrito  **/
      
      var recipe = {
        transcriptionHooks: {
          /* EN Language */
          "START_RADIO" : {
            pattern : "music play",
            command: "RADIO_PLAY"
          },
          "STOP_RADIO" : {
            pattern : "radio stop",
            command: "RADIO_STOP"
          },
          "RADIO_PAUSE" : {
            pattern: "radio pause",
            command: "RADIO_PAUSE"
          },
          "RADIO_NEXT" : {
            pattern: "radio next",
            command: "RADIO_NEXT"
          },
          "RADIO_PREVIOUS": {
            pattern: "radio previous",
            command: "RADIO_PREVIOUS"
          },
       },
        commands: {
          "START_RADIO": {
            notificationExec: {
              notification: "MMM_RADIO-PLAY"
            },
            soundExec: {
              chime: "open"
            }
          },
          "STOP_RADIO": {
            notificationExec: {
              notification: "MMM_RADIO-STOP"
            },
            soundExec: {
              chime: "close"
            }
          },
          "PAUSE_RADIO": {
            notificationExec: {
              notification: "MMM_RADIO-PAUSE"
            }
          },
          "NEXT_RADIO": {
            notificationExec: {
              notification: "MMM_RADIO-NEXT"
            },
          },
          "PREVIOUS_RADIO": {
            notificationExec: {
              notification: "MMM_RADIO-PREVIOUS"
            }
          }
        }
      }
      exports.recipe = recipe
      
      S R 2 Replies Last reply Reply Quote 0
      • S Offline
        sdetweil @negrito
        last edited by

        @negrito you’ve sorta got the voice/command/notification upsidedown

        the notification is “RADIO_PLAY”

        not “MM_RADIO_PLAY”

        so the ‘command’ should be MM_RADIO_PLAY
        which is referenced from the transcription section

        same for all the others

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • R Offline
          Ray @negrito
          last edited by

          @negrito I can give you a copy of mine if you like.
          I’m using Google assistant version 3

          N 1 Reply Last reply Reply Quote 0
          • N Offline
            negrito Project Sponsor @Ray
            last edited by

            @Ray

            Yes please @Ray ,
            I will be very grateful if you give me a copy. Thank you very much in advance.

            Kind regards,
            Negrito

            R 2 Replies Last reply Reply Quote 0
            • R Offline
              Ray @negrito
              last edited by

              @negrito so are you looking to play your own music or actually radio stations.
              I have actually both. That worked pretty well

              1 Reply Last reply Reply Quote 0
              • R Offline
                Ray @negrito
                last edited by

                @negrito Here is my radio set up
                with my personal choices of radio stations.
                I only have a couple right now

                
                var recipe = {
                  transcriptionHooks: {
                    "80+103.7 iHeartRadio From:tuneIn.com": {
                      pattern: "Turn the radio on to 103",
                      command: "103"
                    },
                    "Radio.net 106.9 KFRC": {
                      pattern: "Turn the radio on to 106",
                      command: "106"
                    },
                    "Radio.net 107.7 FM KSAN": {
                      pattern: "Turn the radio on to 107",
                      command: "107"
                    },
                    "radio1": {
                      pattern: "metti radio 1",
                      command: ""                   // command line.
                    },
                    "radioanni90": {
                      pattern: "metti radio anni 90",
                      command: ""
                    },
                    "radio105": {
                      pattern: "metti radio 105",
                      command: ""
                    },
                    "rds": {
                      pattern: "metti rds",
                      command: ""
                    },
                    "rtl1025": {
                      pattern: "metti rtl",
                      command: ""
                    },
                    "radiodj": {
                      pattern: "metti radio dj",
                      command: ""
                    },
                  },
                
                  commands: {
                    "103": {
                      functionExec: {
                        exec: () => {
                          this.radioCommand({
                            img: "https://cdn-profiles.tunein.com/s33596/images/logod.jpg?t=162569",
                            link: "https://n24a-e2.revma.ihrhls.com/zc4342?TGT=TuneIn&maxServers"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                   "106": {
                      functionExec: {
                        exec: () => {
                          this.radioCommand({
                            img: "https://www.radio.net/images/broadcasts/01/97/29350/c300.png",
                            link: "https://19803.live.streamtheworld.com/KFRCHD2.mp3"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                   "107": {
                      functionExec: {
                        exec: () => {
                          this.radioCommand({
                            img: "https://www.radio.net/images/broadcasts/12/ce/29264/c300.png",
                            link: "https://15363.live.streamtheworld.com/KSANFM.mp3"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                    "": {                    // This must match what's in the command line.
                      functionExec: {
                        exec: () => {
                          this.radioCommand({
                            img: "https://www.di-ma.info/radio/radio1.png",
                            link: "http://icestreaming.rai.it/1.mp3"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                    "": {
                      functionExec: {
                        exec: () => {
                          module.radioCommand({
                            img: "https://www.di-ma.info/radio/r90.jpg",
                            link: "http://mp3.hitradiort1.c.nmdn.net/rt190swl/livestream.mp3"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                    "": {
                      functionExec: {
                        exec: () => {
                          this.radioCommand({
                            img: "https://www.di-ma.info/radio/r105.jpg",
                            link: "http://icecast.unitedradio.it/Radio105.mp3"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                    "": {
                      functionExec: {
                        exec: () => {
                          this.radioCommand({
                            img: "https://www.di-ma.info/radio/rds.png",
                            link: "https://icstream.rds.radio/rds"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                    "": {
                      functionExec: {
                        exec: () => {
                          this.radioCommand({
                            img: "https://www.di-ma.info/radio/rtl1025.png",
                            link: "https://streamingv2.shoutcast.com/rtl-1025"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                    "": {
                      functionExec: {
                        exec: () => {
                          this.radioCommand({
                            img: "https://www.di-ma.info/radio/radiodj.png",
                            link: "http://radiodeejay-lh.akamaihd.net/i/RadioDeejay_Live_1@189857/master.m3u8"
                          })
                        }
                      },
                      soundExec: {
                        chime: "open"
                      }
                    },
                  }
                }
                exports.recipe = recipe
                
                

                Let me know if you want the other one that will play your personal music

                N 1 Reply Last reply Reply Quote 0
                • N Offline
                  negrito Project Sponsor @Ray
                  last edited by negrito

                  @Ray
                  @Ray Thank you very much I will give it a try

                  Best rgards,

                  R 1 Reply Last reply Reply Quote 0
                  • R Offline
                    Ray @negrito
                    last edited by

                    @negrito hope it works out for you. Happy to assist

                    N 1 Reply Last reply Reply Quote 0
                    • N Offline
                      negrito Project Sponsor @Ray
                      last edited by

                      @Ray
                      Hello @Ray

                      Unfortunately this recipe doesn’t work, but thanks anyway.

                      R S 2 Replies Last reply Reply Quote 0
                      • R Offline
                        Ray @negrito
                        last edited by

                        @negrito sorry to hear that you do have version 3 of Google assistant
                        is that right

                        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