• 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.

MMM-PIR-Sensor with RelayPin and execute script

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 3 Posters 4.3k Views 3 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.
  • B Offline
    Blackmirror @nogE
    last edited by May 1, 2017, 1:38 PM

    @nogE
    The MMM-PIR-Sensor module have not work at me.

    So i make a new datei this the name PIR.py in my home - ordner.
    And add python PIR.py in the rc.local
    After this was switch the PIR on the GPIO-Pin 13 the relay-pin 37. Add pin 32 i have a button to open the relay manual.

    1 Reply Last reply Reply Quote 0
    • N Offline
      nogE
      last edited by May 1, 2017, 1:51 PM

      when execute the python script (python /home/pi/scripts/light.py), i got following error:

      File “/home/pi/scripts/light.py”, line 22
      read = GPIO.input(PIR_GPIO)

      1 Reply Last reply Reply Quote 0
      • N Offline
        nogE
        last edited by May 1, 2017, 2:10 PM

        Hi,

        i got an error when i run python script. now the whole error message:

        File “/home/pi/scripts/light.py”, line 22
        read = GPIO.input(PIR_GPIO)
        ^
        IndentationError: expected an indented block

        thx

        Y 1 Reply Last reply May 1, 2017, 8:33 PM Reply Quote 0
        • Y Offline
          yawns Moderator @nogE
          last edited by May 1, 2017, 8:33 PM

          @nogE
          Python is a bit tricky. Unlike other languages python needs proper indentation. Make sure you don’t mix up tabs and whitespaces. Best practice is to use 4 whitespaces instead of one tab.

          1 Reply Last reply Reply Quote 0
          • B Offline
            Blackmirror
            last edited by May 2, 2017, 7:21 AM

            Yes, the error code says, you have not enought whitespaces before the lines.

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