@@ -80,3 +80,46 @@ With this it will stay ON for 30 seconds then send OFF message and the timer res
80
80
Set the data pin to ` Switch n ` for it to work.
81
81
82
82
[ Datasheet] ( https://eu.mouser.com/datasheet/2/315/PANA_S_A0004395539_1-2560640.pdf )
83
+
84
+ ## Configuring Tasmota to for Home Assistant
85
+
86
+ To make Home Assistant recognize your PIR sensor automatically, skip all previous steps, and execute
87
+ the following steps to make Tasmota announce your PIR as a motion sensor.
88
+
89
+ 1 . In ** _ Configuration -> Configure Module_ ** menu change your GPIO pin to ` Switch2 ` (or any other switch number).
90
+ 2 . Assuming you picked ` Switch2 ` in the previous step, run this command:
91
+
92
+ ``` console
93
+ Backlog rule1 on switch2#state do publish stat/%topic%/MOTION %value% endon; rule1 1; switchmode2 1, so19 1
94
+ ```
95
+
96
+ 3 . Run this very-long command all at once:
97
+
98
+ ``` console
99
+ rule2 on system#boot do publish2 homeassistant/%topic%/config {
100
+ "name": "Motion Sensor",
101
+ "state_topic": "stat/%topic%/MOTION",
102
+ "payload_on": 1,
103
+ "availability_topic": "tele/%topic%/LWT",
104
+ "payload_available": "Online",
105
+ "payload_not_available": "Offline",
106
+ "device_class": "motion",
107
+ "force_update": true,
108
+ "off_delay": 30,
109
+ "unique_id": "%deviceid%_motion",
110
+ "device": {
111
+ "identifiers": [
112
+ "%deviceid%"
113
+ ]
114
+ }
115
+ } endon
116
+ ```
117
+
118
+ 4 . Run the following two commands to enable the rule, and then restart the device:
119
+
120
+ ``` console
121
+ Rule2 1
122
+ Restart 1
123
+ ```
124
+
125
+ 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