diff --git a/docs/PIR-Motion-Sensors.md b/docs/PIR-Motion-Sensors.md index 268843bc2c..38bcb35c39 100644 --- a/docs/PIR-Motion-Sensors.md +++ b/docs/PIR-Motion-Sensors.md @@ -2,7 +2,7 @@ PIR motion sensors, albeit called sensors, are configured as switches in Tasmota Most PIR's are single wire and they require connecting to VCC, GND and one GPIO. In this guide we will use `GPIO13` as the pin that the PIR output is connected to. See [PIN Restrictions](Peripherals.md#restrictions) on which pins not to use -### Tasmota Settings +### Tasmota Settings for Rules In **_Configuration -> Configure Module_** menu change `GPIO13` to `Switch1`. ![Step 1](_media/GPIO13-switch.png) @@ -26,6 +26,25 @@ This creates a dummy relay which is triggered by the PIR so you can see the chan A more [advanced example](Rules#auto-off-motion-sense-switch) of rules with PIRs. +### Tasmota Settings for HomeAssistant Autodiscovery + +Alternatively, a PIR motion sensor can be configured as a switch with its state reported for autodiscovery by HomeAssistant. + +[Detach switches from relays](https://tasmota.github.io/docs/Commands/#setoption114) and send MQTT messages instead: + +```console +SetOption114 1 +``` + +To have switches discovered SwitchTopic must be set to a custom name. And the [switch mode](https://tasmota.github.io/docs/Buttons-and-Switches/#switchmode) should be set to follow. + +```console +SwitchTopic1 pir +SwitchMode1 1 +``` + +After this, the PIR sensor "switch" will be autodiscovered in Home Assistant as a sensor. + ## AM312 [AM312](http://www.image.micros.com.pl/_dane_techniczne_auto/cz%20am312.pdf) works even on 3.3v instead of 5v (like HC-SR501) which makes it perfect for ESP8266 devices without a 5V line (like Sonoff Basic). It is also less prone to false triggers due to Wi-Fi interference.