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.9k 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.
    • M Offline
      MaengMarco
      last edited by

      I would love to control a relay.
      So I want to turn on and turn off a bulb.
      If you know a way, can you tell me the way?

      1 Reply Last reply Reply Quote 0
      • UnboredU Offline
        Unbored
        last edited by

        I recently worked through a similar issue.

        https://forum.magicmirror.builders/topic/2452/python-one-momentary-switch-led-and-a-shut-off-timer

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

          @Unbored
          Thank you for your answer.
          I checked your URL.
          But this code is Python script.
          Do you know what should I do for use this Python script?

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

                      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