hass-workstation-service icon indicating copy to clipboard operation
hass-workstation-service copied to clipboard

Received message on illegal discovery topic

Open iankaufmann opened this issue 3 years ago • 6 comments

I have been running Home Assistant OS and the official MQTT addon for a while now and without Auto-Discovery. I always liked to define my own entities in the past, and had no trouble getting HASS Workstation Service working with manually defined entities.

However, I've recently turned on Auto-Discovery on the MQTT broker (for use with another integration), and ever since, my logs have been filled with thousands of warnings like this:

Received message on illegal discovery topic 'homeassistant/sensor/WORKSTATION/Session State/config' Received message on illegal discovery topic 'homeassistant/sensor/WORKSTATION/CPU Usage/config' Received message on illegal discovery topic 'homeassistant/sensor/WORKSTATION/Last Active/config' Received message on illegal discovery topic 'homeassistant/sensor/WORKSTATION/RAM Usage/config' Received message on illegal discovery topic 'homeassistant/sensor/WORKSTATION/Current User/config'

Could also be what is going on here: https://github.com/sleevezipper/hass-workstation-service/issues/95

I'm not sure what the MQTT integration isn't liking about the format of these discovery topics: https://github.com/home-assistant/core/blob/a5eb2ac7b77e8c0df541cad0bb461585932325df/homeassistant/components/mqtt/discovery.py#L102

iankaufmann avatar Jul 24 '21 19:07 iankaufmann

Thanks for creating an issue. I think it may be because there's spaces in your sensor names. This was an issue in an older version but it should be fixed at this point. What version are you running?

sleevezipper avatar Jul 25 '21 18:07 sleevezipper

Thanks for getting back to me!

Looks like I am on the latest build: hass-workstation-service-1.0.0.40823

If a quick and easy fix is to just add underscores to all of the sensor names, then I could just do that. I know that spaces are discouraged in MQTT but it does work, unless there is something different about /config topics specifically?

Like I said, I have all of these sensors defined manually, and they all work fine.

I only noticed this when enabling autodiscovery.

iankaufmann avatar Jul 25 '21 19:07 iankaufmann

I am getting this in my logs too. I have deleted the sensors, yet these still appear? Is there somewhere else I need to remove something?

2021-08-17 07:52:42 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/sensor/DESKTOP-Q3VHR9S/Last Active/config'
2021-08-17 07:52:42 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/sensor/DESKTOP-Q3VHR9S/Desktop Memory/config'
2021-08-17 07:52:42 WARNING (MainThread) [homeassistant.components.mqtt.discovery] Received message on illegal discovery topic 'homeassistant/sensor/DESKTOP-Q3VHR9S/Desktop CPU/config'

cogneato avatar Aug 17 '21 14:08 cogneato

After finding the error present even when hass workstation was not active, I cleared the mosquitto.db and am no longer seeing these messages. 👍

cogneato avatar Aug 20 '21 18:08 cogneato

After finding the error present even when hass workstation was not active, I cleared the mosquitto.db and am no longer seeing these messages. 👍

Hi, how did you manage to clear the db?

raidnet-ms avatar Jan 08 '22 22:01 raidnet-ms

I just had this issue as well, for those who are reading through it and not totally sure how to clear the mosquitto.db. Grab a copy of mqtt explorer: https://mqtt-explorer.com/ Since I had deleted these sensors long ago, I just went in and deleted the topics in question.

ewelin34 avatar Feb 19 '22 17:02 ewelin34