Help . Door switches sending mqtt message but nothing changes

I have a esp8266 with magnetic switch for a door sensor. When door is open it sends a 1 to the topic, and closed sends a 2. My configuration.yaml is below. When messages are sent, nothing is happening. T

binary_sensor:

  • platform: mqtt
    state_topic: “sensor/doorbell/door-status”
    name: “Entrance Door”
    payload_on: “1”
    payload_off: “2”
    device_class: opening

what are you using to verify the messages are being sent?

what do you expect to happen?

also you need to format your code properly for the forum so we can see syntax errors.

im using MQTT.fx as a client and subscribing to all messages.

what im expecting to happen is within homeassist the status will change. Would like to do some automations.

the code except for the bullet was exactly as in the configuration.yaml

binary_sensor:

  • platform: mqtt
    state_topic: “sensor/doorbell/door-status”
    name: “Entrance Door”
    payload_on: “1”
    payload_off: “2”
    device_class: opening

post a screen shot of the output of mqttfx with the sensor triggering on & off.

are you sure that HA is connected to the MQTT broker so it can receive the messages?

if the code you posted above is “exactly” like the code in your configuration then you have spacing issues and you are using the wrong type of quotation marks. But I can’t tell if that’s true unless you format your code correctly using the gif I posted.

Im confident that HA is connected to the MQTT broker. HA has the broker addon.

Screen shot of actual config for sensor

Can you go to the services section of HA and publish to a random topic and verify that it shows up in mqttfx?

How have you confirmed that it is connected to the broker?

Use Home Assistant’s MQTT page to publish a 1 to sensor/doorbell/door-status. If the binary sensor doesn’t change state then Home Assistant isn’t connected to the broker.

Screenshot%20from%202019-04-06%2021-17-36

i published from HA, it shows in mqtt.fx , but it doesnt change the sensor state.

On the whim I just upgrade to .91.1 . Everything is working now. The problems were happening on .89.2

Glad to hear it … but it’s not likely it was related to Home Assistant’s version. I use MQTT extensively and my production system is currently running 0.89 without any MQTT issues (test system is running 0.91, also without MQTT problems).

Anyway, if you should encounter the issue again, we’re here to help.