MagicMirror Forum

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

    UNSOLVED PIR sensor in combination with IR transmitter

    General Discussion
    pir sensor hdmi-cec ir transmitter
    2
    4
    292
    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.
    • E
      erwindenboer last edited by

      Hello,

      For my first Magic Mirror, I want to use an old TV that I have lying around. My TV uses Simplelink (CEC), so commands can be sent to my TV to turn on. Unfortunately, it can’t turn off using Simplelink (CEC). To solve this, I want to use an IR led. I also have an PIR sensor. So what I want is when a person moves in front of the PIR sensor, a signal will be transmitted via the IR led to my TV to turn on. After a certain amount of time, I want the Raspberry Pi to signal to the TV to turn off. I couldn’t find a module which does this. I hope someone has an idea how to realize this idea.

      Kind regards.

      S 2 Replies Last reply Reply Quote 0
      • S
        sdetweil @erwindenboer last edited by sdetweil

        @erwindenboer you don’t need a module to do this. or anything MagicMirror

        most of the pir support is in python, and I’m sure u can find python support for sending the led signal.

        then is wait and launch the shutdown command

        you should be able to build this as a bash script

        #!/bin/bash
        python command to read the pir
        python command to send the led signal
        sleep n seconds
        shutdown now -h
        

        if you use pm2 to start mm, you can also use it to start this bash script

        reference
        pir
        https://www.deviceplus.com/raspberry-pi/using-pir-motion-sensors-with-the-raspberry-pi-and-python/

        send ir
        https://www.raspberrypi.org/forums/viewtopic.php?t=79978

        Sam

        Create a working config
        How to add modules

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

          @erwindenboer also, make sure there is a good delay on the pir sensor. you’d be amazed how easy it is to trip the durned thing.

          Sam

          Create a working config
          How to add modules

          1 Reply Last reply Reply Quote 0
          • E
            erwindenboer last edited by

            @sdetweil Thanks for your fast reply. I will test this out next week. Then I will come back to you to let you know if I have more questions or if I solved it. I really appreciate it!

            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