@@ -78,3 +78,46 @@ With this it will stay ON for 30 seconds then send OFF message and the timer res
78
78
Set the data pin to ` Switch n ` for it to work.
79
79
80
80
[ 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