arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.75k stars 4.72k forks source link

The problem of The HC-SR501 PIR Motion Detection in sonoff #559

Closed vaguecupid closed 6 years ago

vaguecupid commented 7 years ago

I want add HC-SR501 PIR Motion Detection to the sonoff, so I set GPIO14 to 09switch1, set GPIO1 to 10switch2, set SwitchMode to 0, set SwitchTopic to 1. I add the switch to GPIO14, and PIR to GPIO1.

the result is switch can work perfectly, the PIR can work,but console and MQTT always show(no “OFF”):

cmnd/sonoff/POWER2 = ON stat/sonoff/RESULT = {"Command":"Unknown"} cmnd/sonoff/POWER2 = ON stat/sonoff/RESULT = {"Command":"Unknown"}

davidelang commented 7 years ago

cmnd/ switches relays, not switches. you would need to have two relays defined before power2 does anything

vaguecupid commented 7 years ago

I test the relay,but PIR(relay 2) can not work.

jhlweb commented 6 years ago

set Switchmode2 1 this lets switch2 follow the state and publishes it. See #420

EdelHert commented 6 years ago

Thanks jhlweb, thats works for me. The only problem I am having still is that the switch does not stay on. It turns on for 36 seconds (PIR-delay), then turns off, even with motion, and turns on after 6 seconds again.. Any idea how I can make it to stay on until no motion is detected?

stale[bot] commented 6 years ago

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.

stale[bot] commented 6 years ago

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.