core: MQTT Binary Sensor Unavailable

The problem

I have a MQTT Binary Sensor setup with Home Assistant along with the Mosquitto broker add on.

However, it seems to be stuck at Unavailable, even after sending a bunch of messages that should trigger the state.

Screen Shot 2022-02-19 at 7 41 17 PM Screen Shot 2022-02-19 at 7 42 08 PM

What version of Home Assistant Core has the issue?

core-2022.2.9

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

MQTT Binary Sensor

Link to integration documentation on our website

https://www.home-assistant.io/integrations/binary_sensor.mqtt/

Diagnostics information

No response

Example YAML snippet

binary_sensor:
  - platform: mqtt
    name: "Laundry Room Power"
    state_topic: "home-assistant/laundryroom/power/state"
    payload_on: "on" # Power
    payload_off: "off" # No Power
    availability:
      - topic: "home-assistant/laundryroom/power/availability"
        payload_available: "online"
        payload_not_available: "offline"
    qos: 1
    device_class: power
    value_template: "{{ value_json.state }}"
    expire_after: 120
    off_delay: 300

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

@Lavaerius I just managed to fix it myself! Weird thing, I had to add qos : 0 to get it working. Or maybe the stars just aligned after 20-30 restarts and attemptsā€¦ šŸ¤£