MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Can I control a relay on MagicMirror2?

    Development
    5
    9
    4248
    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
      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
      • Unbored
        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
          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
            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
              MaengMarco last edited by

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

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

                  cowboysdude 1 Reply Last reply Reply Quote 0
                  • cowboysdude
                    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
                    • johnsonkao
                      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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy