Sonoff Mini with PIR HC-SR501 as Switch1n

54 views
Skip to first unread message

Calin Balanean

unread,
Aug 17, 2020, 6:17:27 PM8/17/20
to TasmotaUsers
Hi all,

Just curious if anyone has tried using the PIR HC-501 with Sonoff Mini.
I powered PIR from Sonoff Mini's 5V. Then I hooked up the ground to S1 and PIR data to S2. I configured GPIO4 as SWITCH1n and set a rule to set POWER according to the switch state.
The problem I'm having is a LOT of false positives. It just bounces back and forth.
Here's just the latest few minutes log: 
17:57:50 RUL: SWITCH1#STATE performs "POWER 0"
17:57:50 MQT: stat/sonoffmini1/RESULT = {"POWER":"OFF"}
17:57:50 MQT: stat/sonoffmini1/POWER = OFF
17:57:56 RUL: SWITCH1#STATE performs "POWER 1"
17:57:56 MQT: stat/sonoffmini1/RESULT = {"POWER":"ON"}
17:57:56 MQT: stat/sonoffmini1/POWER = ON
17:59:14 RUL: SWITCH1#STATE performs "POWER 0"
17:59:14 MQT: stat/sonoffmini1/RESULT = {"POWER":"OFF"}
17:59:14 MQT: stat/sonoffmini1/POWER = OFF
17:59:21 RUL: SWITCH1#STATE performs "POWER 1"
17:59:21 MQT: stat/sonoffmini1/RESULT = {"POWER":"ON"}
17:59:21 MQT: stat/sonoffmini1/POWER = ON
18:01:34 RUL: SWITCH1#STATE performs "POWER 0"
18:01:34 MQT: stat/sonoffmini1/RESULT = {"POWER":"OFF"}
18:01:34 MQT: stat/sonoffmini1/POWER = OFF

Not sure what I'm doing wrong.

Thanks,
Calin

Philip Knowles

unread,
Aug 18, 2020, 1:21:30 AM8/18/20
to TasmotaUsers, Calin Balanean
The 'n' option is no pullup and you may be getting noise. I believe the device goes high when it sees an object so switch1i would be the correct setting.
Regards
Phil K

Sent from Outlook Mobile


From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Calin Balanean <cbal...@gmail.com>
Sent: Monday, August 17, 2020 11:17:27 PM
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Sonoff Mini with PIR HC-SR501 as Switch1n
 
--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/1954f3a0-4c0f-457e-b115-00be39c0ee20n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages