OK, at least we know it’s from discovery. It could be mentioned in the log.
But if it comes from mqtt, then mentioning the mqtt topic should be possible which would improve debugging in 100%. Maybe even the entity which this template is created for.
then this topic contains references to the entity topic, isn’t it?
Often those topics have something in common (ie named with the use of mac address etc). at least something.
Anyways, I’m sure something could be done with template entities and configured entities but in regards to MQTT discovery, there’s nothing that could be done because you wouldn’t be able to correct it. You’re at the mercy of whoever is creating the discovery, and it likely requires code changes.
Well it’s not a simple change, and it would require code changes all across integrations that use Templates. I don’t think this will happen anytime soon. If it does happen, it would slowly roll out to integrations one at a time.
The problem is the template is registered before the entity is fully created. So we have nothing to reference when registering the template.
It has to be true if you say so.
I imagined, that it’s the HA that picks data from mqtt and then complains about their quality. So it seemed to be easy to add an mqtt topic name the data comes from to the log.
The template errors when the topic updates. The template isn’t checked immediately when it’s discovered. But during discovery, all we have at that point is the discovery info, not the entity info because the entity hasn’t been created. I’ll see if something can be added to MQTT, I’m pretty sure template entities already provide the entity_id in these types of errors. MQTT would likely fix the majority of these phantom template errors