Need help with Tasmota,reed switch, mqtt.HA

I made a magnetic reed switch door sensor using a NodeMCU ESP8266 flashed with Tasmota. It sends correct mqtt messages when I open and close the door. I confirmed these messages on Node Red running as a Hassio addon.

The mqtt open and close messages are as follows:
… door open 00:53:10 MQT: stat/cellar_door/Result = {“1”}
… door closed 00:53:07 MQT: stat/cellar_door/Result = {“0”}

I added this to Home Assistant with the following in my configuration.yaml.
binary_sensor:

Magnetic Door Sensors

  • platform: mqtt
    state_topic: “stat/cellar_door/Result”
    name: CellarDoor
    payload_on: “1”
    payload_off: “0”
    device_class: door

The device appears with an open door icon on HA and the entity is listed as follows:
binary_sensor.cellardoor
state off
friendly_name: CellarDoor
device_class: door

The device is completely dead however. No state changes occur with opening and closing the door. I have spent many hours tweaking unsuccessfully. Help would be much appreciated. Charlie

Here is what my HA log is telling me…
2019-08-13 20:27:10 WARNING (MainThread) [homeassistant.components.mqtt.binary_sensor] No matching payload found for entity: CellarDoor with state_topic: stat/cellar_door/Result

My problem appears to be in the payload of the mqtt messages. The device is sending payloads of “0” or “1” via mqtt but this isn’t what HA wants

I tried changing the payload in config.yaml to “On” or “Off” and “Open” or “Closed” but it didn’t fix it.

From the HA documentation:
“Binary sensors gather information about the state of devices which have a “digital” return value (either 1 or 0). These can be switches, contacts, pins, etc. These sensors only have two states: 0/off/low/closed/false and 1/on/high/open/true .”

How do I get these payloads to match?
Charlie

I had an issue like that once.
All was working fine until a certain HA upgrade, I forget which.
Turns out that I copied and pasted from a forum instead of typing and ended up getting the ‘pretty’ quotes like these “1” instead of these: "1".