Room Assistant Illegal Discovery Topics that end in "config"

I’m seeing errors in the logs. They look like this:

[homeassistant.components.mqtt.discovery] Received message on illegal discovery topic ‘homeassistant/switch/room-assistant/xxx.xx.xxx.xx-bluetooth-classic-inquiries-switch/config’

It seems to be coming from the mqtt discovery.py because the topics end in config.

I can’t seem to figure out if this is a problem with my configuration or an issue with either room assistant or home assistant and I would appreciate any insights anyone may be able to offer.

The proper format for a discovery topic is:

<root>/<domain>/<object_id>/config

So the complain is about the “xxx.xx.xxx.xx-bluetooth-classic-inquiries-switch” part, here, so likely an issue on the room assistant config.

Thanks for the quick response. I was looking at the source code for discovery.py (https://github.com/home-assistant/core/blob/5c91d8d3799cf9f3690da3fa15abea0e64698e16/homeassistant/components/mqtt/discovery.py) and lines 99-104 look like this which is why it looked like the complaint was about the “config” at the end rather than the IP address. Am I mistaken?

         if not match:
            if topic_trimmed.endswith("config"):
                _LOGGER.warning(
                    "Received message on illegal discovery topic '%s'", topic
                )
            return

It will not enter this if the topic is properly structured as shown above.

1 Like

Thank you. You are absolutely correct about the root cause of the log warnings I observed. I appreciate the extra effort you took explaining it to me.