• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

LED Backlight for mirror - PIR to control them

Scheduled Pinned Locked Moved General Discussion
17 Posts 6 Posters 12.0k Views 6 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.
  • O Offline
    orayoflighto Project Sponsor
    last edited by Aug 21, 2017, 12:19 AM

    I did this.

    alt text

    I used the MMM-PIR-Sensor module and changed the following in node_helper.js:

    From:

            if (data.indexOf("0x120002") !== -1)
              exec("/opt/vc/bin/tvservice --preferred && chvt 6 && chvt 7", null);
    

    To:

            if (data.indexOf("0x120002") !== -1){
              exec("/opt/vc/bin/tvservice --preferred && chvt 6 && chvt 7", null);
              exec("python /home/pi/py-spidev/RPi-LPD8806/LED.py");
           }
    

    and

    From:

          exec("/opt/vc/bin/tvservice -o", null);
    

    To:

          exec("/opt/vc/bin/tvservice -o", null);
          exec("python /home/pi/py-spidev/RPi-LPD8806/off.py");
           }
    

    Note that in the first from - to there is a “)” missing in the original code that you will need to fix. Also note that as soon as the module gets updated if you hack the code like I did above it will be wiped out when you update.

    C 1 Reply Last reply Aug 21, 2017, 12:25 AM Reply Quote 3
    • C Offline
      cowboysdude Module Developer @orayoflighto
      last edited by cowboysdude Aug 21, 2017, 12:26 AM Aug 21, 2017, 12:25 AM

      @orayoflighto NICE!!! What light strips did you use?

      O 1 Reply Last reply Aug 21, 2017, 12:31 AM Reply Quote 0
      • O Offline
        orayoflighto Project Sponsor @cowboysdude
        last edited by Aug 21, 2017, 12:31 AM

        @cowboysdude

        I used these only because they were incredibly cheap and I originally started out looking at MMM-PiLights which uses the same LPD8806 type:

        https://www.amazon.com/gp/product/B01COEJST8/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1

        I used this python code:
        https://github.com/longjos/RPi-LPD8806

        C 1 Reply Last reply Aug 21, 2017, 12:32 AM Reply Quote 2
        • C Offline
          cowboysdude Module Developer @orayoflighto
          last edited by cowboysdude Aug 21, 2017, 12:35 AM Aug 21, 2017, 12:32 AM

          @orayoflighto VERY nice, Thank you!!!

          You outta do a write up with instructions! MANY people would love this!

          1 Reply Last reply Reply Quote 0
          • S Offline
            Snille Module Developer
            last edited by Aug 21, 2017, 7:36 AM

            Just to add some depth to this… If you really want to go “crazy” with animations, I’m recommending Bibliopixel and PixelWeb. Then you can “animate” lot’s and trigger them with a curl “command”. Plus you get a nice Web-interface to test the animations in. :)

            If you cant find it, make it and share it!
            Modules: MMM-homeassistant-sensors, MMM-Modulebar, MMM-Profilepicture, MMM-Videoplayer

            1 Reply Last reply Reply Quote 1
            • K Offline
              Kimzer
              last edited by Aug 21, 2017, 7:53 AM

              Oh lawd! This looks insanely good. Thanks alot for the guide. Out to go buy some strips today! :D

              K 1 Reply Last reply Aug 21, 2017, 11:50 AM Reply Quote 0
              • K Offline
                Kimzer @Kimzer
                last edited by Aug 21, 2017, 11:50 AM

                @Kimzer said in LED Backlight for mirror - PIR to control them:

                Oh lawd! This looks insanely good. Thanks alot for the guide. Out to go buy some strips today! :D

                To quote myself…

                Can i use any sorts of led strips? Im looking to buy something from a store and not order online if possible.
                Im in norway so if anyone knows something i could buy please let me know!

                1 Reply Last reply Reply Quote 0
                • O Offline
                  orayoflighto Project Sponsor
                  last edited by Aug 21, 2017, 8:15 PM

                  Different strips have different ways they need to be programmed. Some have faster refresh rates than others.

                  Most people will suggest ADA102 for beginners. The strips I linked to are LPD8806. As I mentioned previously the only reason I bought those ones is that MMM-PiLights was programmed to use them.

                  1 Reply Last reply Reply Quote 1
                  • M Offline
                    Mirrorolentia
                    last edited by Aug 22, 2017, 5:22 AM

                    Any stats etc on comparison between LPD, APA102, WS2812 and SK series. I find that WS2812B isn’t always able to render all colors properly.

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      Kimzer
                      last edited by Aug 22, 2017, 12:08 PM

                      Anyone know a way to control hue light strips to turn on/off via the pir sensor?

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        9/17
                        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