MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.20.0 is available! For more information about this release, check out this topic.

    Need help - New programmer

    General Discussion
    5
    23
    326
    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.
    • S
      smart_user last edited by

      Hello, I am a 16 year old new programmer and I am in the process of making a smart mirror. My mirror should remind the person to drink water every 1 hour. I am unable to code it to do that. Can somebody help? I will really appreciate it!

      S 1 Reply Last reply Reply Quote 0
      • A
        ashishtank last edited by

        @smart_user Where you are stuck ? check the default modules code, you will need to configure a timer to repeat the task every 1 hour (should be configurable). and in that task you should display message on screen.

        Check window.timeout and window.setInterval function of javascript.

        S 1 Reply Last reply Reply Quote 0
        • S
          sdetweil @smart_user last edited by

          @smart_user you could use my sample module which puts up a configured message every few minutes. Change the message and the time…

          https://github.com/sdetweil/SampleModule

          Sam

          Create a working config
          How to add modules

          S 1 Reply Last reply Reply Quote 1
          • S
            smart_user @ashishtank last edited by

            @ashishtank Yes I will look into it. Thank you so much for the instant reply. Appreciate it a lot

            1 Reply Last reply Reply Quote 0
            • S
              smart_user @sdetweil last edited by

              @sdetweil Thank you so much! I will use this module and let you know how it goes!

              S 1 Reply Last reply Reply Quote 0
              • S
                sdetweil @smart_user last edited by

                @smart_user ok. Timer is in the node_helper.
                It is a one time timer, setTimer, vs repeating, setInterval.

                Doesn’t need to be in the node_helper, but did that to show the structure and communication between the parts

                Sam

                Create a working config
                How to add modules

                1 Reply Last reply Reply Quote 0
                • S
                  smart_user last edited by

                  @sdetweil It still isn’t working. I had configured for the alert to show up in 10 seconds but it didn’t

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    sdetweil @smart_user last edited by sdetweil

                    @smart_user you changed the 15000 in node_helper to 10000, right?

                    And u had a position: set in config.js, right?

                    Sam

                    Create a working config
                    How to add modules

                    1 Reply Last reply Reply Quote 0
                    • S
                      smart_user last edited by

                      @sdetweil Yes

                      1 Reply Last reply Reply Quote 0
                      • S
                        smart_user last edited by

                        @sdetweil Is it possible for you to send me a picture of the .js file so I can double check?

                        S 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 3
                        • 1 / 3
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy