Hello I started using Home assistant newly and I got a noob question about my motion sensor connected with Open MQTT Gateway. I want to add it over mqtt. I get the following code {“hcsr501”:“true”} or {“hcsr501”:“false”} if there is motion or not. Its published etc. but Iam to stupid to integrate the sensor into HA. Here is my yaml:
binary_sensor:
- platform: mqtt
name: "Bewegung_Schlafzimmer"
device_class: motion
state_topic: "home/OpenMQTTGateway1/HCSR501toMQTT"
#value_template: "{{ trigger.payload_json['hcsr501'] }}"
payload_on: "{{ trigger.payload_json['hcsr501'] == true }}"
payload_off: "{{ trigger.payload_json['hcsr501'] == false }}"
But the state is not beeing changed. Any suggestions what Iam doing wrong? Thank you very much