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.

    PIR sensor in combination with IR transmitter

    Scheduled Pinned Locked Moved Unsolved General Discussion
    pir sensorhdmi-cecir transmitter
    4 Posts 2 Posters 830 Views 2 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.
    • E Offline
      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 Offline
        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

        How to add modules

        learning how to use browser developers window for css changes

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

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • E Offline
            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 Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy