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.

    Can I control a relay on MagicMirror2?

    Scheduled Pinned Locked Moved Development
    9 Posts 5 Posters 5.3k Views 5 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.
    • S Offline
      shbatm Module Developer
      last edited by

      You may want to take a look at the MMM-PIR-Sensor module and see if you can adapt it for your needs. It includes the ability to control a relay for turning on/off the monitor.

      1 Reply Last reply Reply Quote 1
      • M Offline
        MaengMarco
        last edited by

        @shbatm Thank you.
        Can I use a bulb instead of a monitor?

        cowboysdudeC 1 Reply Last reply Reply Quote 0
        • cowboysdudeC Offline
          cowboysdude Module Developer @MaengMarco
          last edited by

          @MaengMarco said in Can I control a relay on MagicMirror2?:

          @shbatm Thank you.
          Can I use a bulb instead of a monitor?

          Sure why not? They’ve been doing it a while

          example: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=82316

          M 1 Reply Last reply Reply Quote 0
          • M Offline
            MaengMarco @cowboysdude
            last edited by MaengMarco

            @cowboysdude
            Yes. I saw. But I make to turn on & turn off a bulb on MagicMirror2.
            I use to voice control used ‘annyang API’.
            If I say " Turn on the light.", a bulb will turn on.
            I think to make a new module about voice and relay control, right?
            But It is very difficult…

            cowboysdudeC 1 Reply Last reply Reply Quote 0
            • cowboysdudeC Offline
              cowboysdude Module Developer @MaengMarco
              last edited by

              @MaengMarco Check the voice control software you’re going to use… I’m sure they have some sort of instructions on how to…

              1 Reply Last reply Reply Quote 0
              • johnsonkaoJ Offline
                johnsonkao
                last edited by

                Using WebIOPI is simple way to control GPIOs . The followings is my solution.

                1. To install WebIOPI to your raspberry Pi.
                  webiopi Installation
                  Note: if you use webiopi 0.7 and rasp 2, you have to run the patch.

                2. In the node_help.js of your module, use ‘http post’ to control the GPIOs.
                  WebIOPI rest api
                  ex:
                  SET ‘GPIO 3’ to ‘IN’ , the request as below:
                  HTTP POST
                  http:/192.168.1.200:8000/GPIO/3/function/in

                Happy programming~

                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