How to automatically discover binary sensor devices through discovery topic

I tried the subject and content like this according to the documentation, unfortunately I get an error in log.

Topic: homeassistant/presence/portal-body-sensor/config
Content:

{
        "name": "portal-body-sensor",
        "device_class": "presence",
        "state_topic":  "portal/binary_sensor/body-sensor/status",
        "unique_id":    "portal-body-sensor"
}

Log:

Integration presence is not supported

and I have tried these types: door, opening, plug. But same thing.

The error message is correct, there’s no such thing as a Presence integration.

Your MQTT Discovery topic contains the word “presence”. Change it to “binary_sensor”.

homeassistant/binary_sensor/portal-body-sensor/config

The MQTT Discovery payload is correct; presence is a valid value for a Binary Sensor’s device_class.

1 Like

Thanks! I have resolved.

BEST REGARD.

1 Like

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.

1 Like