Tasmota: PIR with sonoff basic..?

Created on 5 May 2017  路  6Comments  路  Source: arendst/Tasmota

any one have any info to connect a PIR sensor to a sonof basic..?

stale

Most helpful comment

It's not very well documented.
But you have to set a switch1 to switch4 as the state for a GPIO pin.
send the command Switchmode(number of the switch) 1 and set the SwitchTopic to 1 or a topic string.

This what is did:
Connect the PIR on/off pin to a GPIO pin. In my case i use a Wemos D1, i use D2= GPIO4

http://<SONOFF-IP>/cm?cmnd=Gpio4 10
http://<SONOFF-IP>/cm?cmnd=SwitchMode2 1
http://<SONOFF-IP>/cm?cmnd=SwitchTopic Sonoff-clock1
http://<SONOFF-IP>/cm?cmnd=Restart 1

The output to MQTT is:

19:30:42 MQT: cmnd/Sonoff-clock1/POWER2 = ON
19:30:45 MQT: cmnd/Sonoff-clock1/POWER2 = OFF

All 6 comments

see the wiki page on connecting additional things to a sonoff

you can also have a look here. https://groups.google.com/forum/#!topic/sonoffusers/GAv0qnjA04A there are some pictures and discussion

this may have been answered before , but is it is clear that a good example is needed , as there are many people looking for this information .

if we need to connect a PIR to , gpio14 as input , and configure gpio14 for button2 , then , how we read the status of this new button2 , which topic?, which command to request status , ?
i tried , everithing that could possible make sense , no luck so far ,
i would appreciate if somebody could help , thankyou

It's not very well documented.
But you have to set a switch1 to switch4 as the state for a GPIO pin.
send the command Switchmode(number of the switch) 1 and set the SwitchTopic to 1 or a topic string.

This what is did:
Connect the PIR on/off pin to a GPIO pin. In my case i use a Wemos D1, i use D2= GPIO4

http://<SONOFF-IP>/cm?cmnd=Gpio4 10
http://<SONOFF-IP>/cm?cmnd=SwitchMode2 1
http://<SONOFF-IP>/cm?cmnd=SwitchTopic Sonoff-clock1
http://<SONOFF-IP>/cm?cmnd=Restart 1

The output to MQTT is:

19:30:42 MQT: cmnd/Sonoff-clock1/POWER2 = ON
19:30:45 MQT: cmnd/Sonoff-clock1/POWER2 = OFF

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smadds picture smadds  路  3Comments

wirelesssolution picture wirelesssolution  路  3Comments

esp32x picture esp32x  路  3Comments

Vujagig picture Vujagig  路  3Comments

Joeyhza picture Joeyhza  路  3Comments