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.

    Display random gif from folder

    Scheduled Pinned Locked Moved Requests
    9 Posts 2 Posters 1.7k 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.
    • F Offline
      fillilutten @fillilutten
      last edited by

      This seems perfect just missing some kind of folder selection or some way to choose what specific group of images to display.

      https://github.com/skuethe/MMM-RandomPhoto

      A 1 Reply Last reply Reply Quote 0
      • A Offline
        ashishtank Module Developer @fillilutten
        last edited by

        @fillilutten Did you checked https://github.com/AdamMoses-GitHub/MMM-ImageSlideshow ? this is showing random images from folder(s) on disk. You need to stop the loop to show one image which should be easily doable.

        F 1 Reply Last reply Reply Quote 0
        • F Offline
          fillilutten @ashishtank
          last edited by

          @ashishtank I did but to my understanding I can’t tell that module with some kind of command to start showing images/gifs from one specific folder. That one just continues to the next in order, right? I want to be able to say via mqtt or http or something else - ok, now show random images from the folder called “rain”, “sunny” or “cloudy” etc.

          A 1 Reply Last reply Reply Quote 0
          • A Offline
            ashishtank Module Developer @fillilutten
            last edited by

            @fillilutten That is what I said :) you need to stop the loop to either show one image or you can also tell it to only show images from one specific folder. I think https://github.com/AdamMoses-GitHub/MMM-ImageSlideshow should be easily changed to achieve your requirements

            1 Reply Last reply Reply Quote 0
            • F Offline
              fillilutten
              last edited by

              Unfortunately, even if it’s probably really easy, I don’t think I have the knowledge to edit in the code. But a new thought was - Isn’t there any module that you can “cast” or send image to? Just to send and img url. Then I could just push a gif or image to the magicmirror and fix all the other automations and etc in Node red + Home assistant.

              A 1 Reply Last reply Reply Quote 0
              • A Offline
                ashishtank Module Developer @fillilutten
                last edited by

                @fillilutten There few modules which can be used to display image or html content MMM-HTMLSnippet and MMM-iFrame but not sure if you can just use them or can send notification to change the content or url.

                If you learn html, css and JS it would be useful and fun :) . I have used MMM-EyeCandy module to show image from notification.

                Do below

                1. get MMM-EyeCandy from https://github.com/mykle1/MMM-EyeCandy
                2. edit the MMM-EyeCandy.js file and add below code.
                else if (notification === 'SHOW_EYECANDY_IMG') {
                			this.url = payload;
                			this.updateDom();
                        }
                
                1. full function should look like below
                    notificationReceived: function(notification, payload) {
                        if (notification === 'HIDE_EYECANDY') {
                            this.hide();
                        } else if (notification === 'SHOW_EYECANDY') {
                            this.show(1000);
                        } else if (notification === 'SHOW_EYECANDY_IMG') {
                			this.url = payload;
                			this.updateDom();
                        }
                
                    },
                
                1. Using telegram or remote control module you can send notification SHOW_EYECANDY_IMG with image url to Eye candy to display different image.

                de096b55-bd2e-4a5d-bb77-19ecb24ebb5f-image.png
                c4a39ccb-ed6b-4aaf-b79d-29b45e895f2f-image.png

                F 1 Reply Last reply Reply Quote 0
                • F Offline
                  fillilutten @ashishtank
                  last edited by

                  @ashishtank

                  I’m SO sorry that I forgot to reply to you. I thought I did and found this old thread now. I used your example and can now, with a touch of a button on the wall, display a random gif from giphy on my display. Superfun! Huge thanks for your help!!!

                  A 1 Reply Last reply Reply Quote 0
                  • A Offline
                    ashishtank Module Developer @fillilutten
                    last edited by

                    @fillilutten You are welcome :)

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