Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add description of configuring a switch for autodiscovery. #1223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion docs/PIR-Motion-Sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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.
Expand Down