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.

    Scheduling a YouTube video to start/stop via MMM-Remote-Control

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    4 Posts 2 Posters 908 Views 2 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.
    • M Offline
      madebyelmcity
      last edited by madebyelmcity

      Looking for some guidance. I’m using MMM-ModuleScheduler and MMM-Remote-Control to turn my monitor on/off, and to hide certain modules depending on the time of day. Works great.

      But, I have a YouTube video (white noise) that I’d like to start in the evening, and have stop in the AM.

      Playing the video is no problem — I’m using MMM-EmbedYoutube) as below:

      module: "MMM-EmbedYoutube", 
                      position: "middle_center",        
                      config: {
                              video_id: "nDqP7kcr-sc",
                              loop: true,
                              autoplay:true,
                              controls:false,
                              }
                      },
      
      

      I tried to hide/show the video via MMM-Remote-Control/MMM-Module-Scheduler, but couldn’t figure out why the sound kept playing. Of course, it’s because hiding/showing doesn’t turn it off/on.

      So I’m trying to find solution, but am stuck here as modifying the config.js file is about the limit of my technical knowledge.

      Looking at the page for MMM-YouTube I can see that I can use YouTube’s iFrame API methods to control its player. And this is what I’d want to do:

      this.sendNotification("YOUTUBE_CONTROL", {
        command: "playVideo"
      })
      

      I’m just not sure how/where to create that notification. Ideally I can use the modules above to playVideo or pauseVideo, at certain times of the day.

      Any guidance you can provide would be super helpful!

      ? 2 Replies Last reply Reply Quote 0
      • ? Offline
        A Former User @madebyelmcity
        last edited by A Former User

        @madebyelmcity
        https://github.com/ianperrin/MMM-ModuleScheduler#scheduling-notifications
        shows how to occur notification with payload.

        1 Reply Last reply Reply Quote 0
        • ? Offline
          A Former User @madebyelmcity
          last edited by

          @madebyelmcity
          I was on the way so I couldn’t explain in detailly.
          If you are using https://github.com/ianperrin/MMM-ModuleScheduler , (Personally, I don’t use it, so I might be wrong)
          This could work; Haven’t tested, but…

          {
            module: 'MMM-ModuleScheduler',
            config: {
              notification_schedule: {
                notification: 'YOUTUBE_CONTROL', 
                schedule: '30 9 * * *', 
                payload: {
                    type: "notification", 
                    command: 'pauseVideo'
                }
              }
            }
          },
          
          M 1 Reply Last reply Reply Quote 0
          • M Offline
            madebyelmcity @Guest
            last edited by

            @Sean Thanks! I’ll try it out and report back. Really appreciate the assistance.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • 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