HA, Pi and remote GPIO - PIR sensor

Hi all, firstly as a disclaimer, while I am reasonably technical I have never really used GPIO or done any microelectronics work so please go easy :smiley:

I recently bought the Raspberry Pi PIR case from Pi Hut. I have followed the assembly instructions and connected the PIR sensor to GND, +5v and pin11 (GPIO17).

After a bit of faffing with remote GPIO I have configured HA with the integration, pointing the config file at pin 17 and the device appears in HA. The device is always at “No Motion” or “Off” regardless of my tinkering with the pots on the side.

When I use the example script for motion sensing, it complains that

`PIR Module Test (CTRL+C to exit)`

`Traceback (most recent call last):`

`File "./testpir.py", line 10, in <module>`

`time.sleep(2)`

`NameError: name 'time' is not defined`

so I removed the “time.sleep” and replaced with “sleep” which makes the script run, but it just repeats “Motion Detected!” even if I completely cover up the sensor. I don’t know much about python. This may have broken the script.

So my issue is that HA thinks there is no motion, the PIR (I think) thinks that there is motion all the time, but neither accurately reflect the real world motion status.

Are there any good ways of testing where the fault lies? Has anyone else done this with a pi, PIR and remote GPIO? Are there any good tutorials on the subject?

Thanks for any help you can give!