lucavb / homebridge-hc-sr501

Homebridge plugin for the hc-sr501 motion sensor
GNU General Public License v3.0
10 stars 1 forks source link

Sensor doesn't detect motion #6

Closed silversurfer147 closed 6 years ago

silversurfer147 commented 6 years ago

Hi, I have a problem with my motion sensor HC-SR501. I have successfully added it into homebridge and also in Home app in my iPhone. In app it shows that motion sensor is ready, unfortunately it doesn't detect any motion. I have also tried different pin, but it doesn't help. Here is my config.json

{ "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:FF:AB", "port": 32132, "pin": "034-12-120" }, "accessories" : [ { "accessory" : "HC-SR501", "name" : "Motion Sensor", "pinId" : 24 } ] }

However my motion sensor works, I tried it with code from this example https://electrosome.com/pir-motion-sensor-hc-sr501-raspberry-pi/ and it successfully detected motion. Could someone help me, where could be a problem? Thank you in advance.

SkyJohn commented 6 years ago

Which model of Raspberry Pi do you have?

silversurfer147 commented 6 years ago

Hi, I have B+. However I think, I know where is problem. The script from link which I have posted uses number of pin which are in green circle https://www.raspberrypi-spy.co.uk/2014/07/raspberry-pi-b-gpio-header-details-and-pinout/ , but to config file of homebridge, I have to put number from name of pin (behind GPIO)

SkyJohn commented 6 years ago

Yes, the config requires the GPIO number.

silversurfer147 commented 6 years ago

Great, it works :) Thank you!