@amurka wrote:
Help connect the PIR sensor to Home assistant.
There is esp12 with tasmota firmware.
The PIR sensor is connected to the esp12 pin, in the tasmota settings it is defined as a “switch”. A relay is connected to the other esp12 pin (in the tasmota defined as “relay1”).
In esp12, the rule is configured - when the PIR sensor is triggered, turn on the relay, turn off when the movement ends.Rule1 on Switch1#state=1 do BackLog Power1 1; publish stat/%topic%/PIR1 ON endon on Switch1#state=0 do BackLog Power1 0; Publish stat/%topic%/PIR1 OFF endon Rule1 1
The Home assistant relay was found, displayed as switch.nodemcu_relay1, and controlled from the lovelace card.
I wanted to see the Home assistant state of the PIR sensor. I added in the configuration.yaml sensor:binary_sensor: - platform: mqtt name: "PIR Sensor" state_topic: "stat/nodemcu/PIR1" availability_topic: "tele/nodemcu_125D7E/LWT" qos: 1 payload_on: "ON" payload_off: "OFF" payload_available: "Online" payload_not_available: "Offline" device_class: motion
The sensor appeared in the Home assistant, but its state is unavailable
What other settings need to be made so that this PIR sensor becomes active and can be used in automation?
Posts: 1
Participants: 1