[MQTT integration] Allow wildcards in state_topic

Hello, I have a MQTT device which is regularly changing its ID and along with this the MQTT topic it provides the data.
This leads to regular unavailability of the device in HA and manual effort to discover the new device and rename the device/entities to fix all related automations and helpers.

As a work around I created a template sensor that subscribes to the state topics with a wildcard.
This works well but it’s just an entity now that is not connected to the device.
So I tried to manually add a device in the MQTT integration but here it seems that wildcard topics are not supported, the entites always show unkown when using the asterisk as a wildcard for the ID.

Hello Dominik :de:,

Aaa, the device is identified by that topic. when it changed the device changes to another device.
So if I am understanding you correctly, no, this is not how it works. What you ask is impossible.

A topic with a wildcard is also just a topic, so where’s the issue.

I see that wrong wildcard usage may lead to strange behavior but that’s the same for entities.

The MQTT wildcards are “+” or “#”, not asterisk. Can you show the definition of your MQTT entity?

:man_facepalming:

Thanks Michael, I also realized this today. Creating a manual MQTT device is possible using the correct wildcard symbol.