Skip to content

Commit 2e7531a

Browse files
committed
Add instructions about using PIR sensor with Home Assistant
Rough Source: https://blakadder.com/pir-in-tasmota/
1 parent a32f7d7 commit 2e7531a

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

docs/PIR-Motion-Sensors.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,46 @@ With this it will stay ON for 30 seconds then send OFF message and the timer res
7878
Set the data pin to `Switch n` for it to work.
7979

8080
[Datasheet](https://eu.mouser.com/datasheet/2/315/PANA_S_A0004395539_1-2560640.pdf)
81+
82+
## Configuring Tasmota to for Home Assistant
83+
84+
To make Home Assistant recognize your PIR sensor automatically, skip all previous steps, and execute
85+
the following steps to make Tasmota announce your PIR as a motion sensor.
86+
87+
1. In **_Configuration -> Configure Module_** menu change your GPIO pin to `Switch2` (or any other switch number).
88+
2. Assuming you picked `Switch2` in the previous step, run this command:
89+
90+
```console
91+
Backlog rule1 on switch2#state do publish stat/%topic%/MOTION %value% endon; rule1 1; switchmode2 1, so19 1
92+
```
93+
94+
3. Run this very-long command all at once:
95+
96+
```console
97+
rule2 on system#boot do publish2 homeassistant/%topic%/config {
98+
"name": "Motion Sensor",
99+
"state_topic": "stat/%topic%/MOTION",
100+
"payload_on": 1,
101+
"availability_topic": "tele/%topic%/LWT",
102+
"payload_available": "Online",
103+
"payload_not_available": "Offline",
104+
"device_class": "motion",
105+
"force_update": true,
106+
"off_delay": 30,
107+
"unique_id": "%deviceid%_motion",
108+
"device": {
109+
"identifiers": [
110+
"%deviceid%"
111+
]
112+
}
113+
} endon
114+
```
115+
116+
4. Run the following two commands to enable the rule, and then restart the device:
117+
118+
```console
119+
Rule2 1
120+
Restart 1
121+
```
122+
123+
Note that this configuration, much like the rest of the examples on this page, don't show the PIR sensor's state on the home screen of Tasmota.

0 commit comments

Comments
 (0)