richibrics / IoTuring

Your Windows, Linux, macOS computer as MQTT and HomeAssistant integration
https://pypi.org/project/IoTuring/
GNU General Public License v3.0
70 stars 6 forks source link

Tag with space creates illegal discovery topic #40

Closed infeeeee closed 1 year ago

infeeeee commented 1 year ago

HomeAssistant topics are not sanitized for space characters. Home Assistant doesn't allow topics with spaces.

To reproduce:

  1. Create a multi instance entity (e.g. Notify)
  2. At the Tag prompt add a space somewhere (e.g.: Notify message)
  3. Home Assistant won't discover this entity, and this appears in the log: Received message on illegal discovery topic 'homeassistant/button/IoTuring/gydesktop_Entity_Notify_Notify message_notify/config'. The topic contains not allowed characters. For more information see https://www.home-assistant.io/docs/mqtt/discovery/#discovery-topic