No matching payload found for entity (mqtt binary_sensor)

I created a binary sensor for my motion detection. The value is send by Zwave2Mqtt. It is sending a true or false. So this is my sensor in my configuration:

  • platform: mqtt
    state_topic: “z2m/4/48/1/0”
    name: “motion_sensor_woonkamer_sensor”
    payload_on: “true”
    payload_off: “false”
    device_class: motion

But somehow it is not working and i dont know why. I keep getting this message:

No matching payload found for entity: motion_sensor_woonkamer_sensor with state topic: z2m/4/48/1/0. Payload: true, with value template None

I am realy sure that the mqtt message only contains the word true or false.

I dont know which template i have to use.
For other sensors which are sending 1 and 0 or on and off it is working without template (off course with the right payload_on and off filled in)

could you try adding to your sensor this?

value_template: '{{ value }}'

I think I tried it before because I use it also with normal sensors. It gave me this warning:

Payload: true, with value template Template("{{ value }}")

your warning is very odd…

this code works for me as expected when I publish ‘true’ to z2m/4/48/1/0

- platform: mqtt
  state_topic: z2m/4/48/1/0
  name: motion_sensor_woonkamer_sensor
  payload_on: 'true'
  payload_off: 'false'
  device_class: motion

I created a test sensor by myself and it was working correctly. So i changed the name of my sensor and it was also working.

This sensor used to be an entity from zwave. But now i changed to zwave2mqtt but re-using the names. I did not had any problems except this one.

Thanks for helping

1 Like