Help me find a lost sensor

I created a sensor some years ago, likely in my configuration.yaml. Today, I can’t find where it is defined. In Developer Tools/States, I see the sensor. However a grep of everything in my Home Assistant files and a text search in my Node-Red add-on doesn’t tell me where the sensor is defined.

In Developer Tools, States, I click on “More Info” and get this:

more info

When I click on “Settings”, I get this:

settings

No surprise since it was originally created in configuration.yaml.

When I click on the meatball menu, then “Related”:

related

OK, it is in the MQTT Integration?
But it is not. I can’t find it in the integration either as a device or as an entity.

Any guess where this sensor is defined?

Is your configuration yaml split up for certain sensors?

Yes, but a grep of all yaml files shows no results.

I think that MQTT message shows up for discovered MQTT sensors once you have any MQTT definitions in your config.yaml. So maybe it was auto-discovered?

Years ago it was defined in mqtt.yaml, itself included in configuration.yaml. But with 2023.4 this was depreciated and mqtt.yaml was deleted. The release notes indicate that these definitions are “now configured via the GUI.”

I don’t think the mqtt sensors that were configured in yaml were automatically migrated in the update. You may be able to create new ons in the UI but be sure and check your yaml files to find this device. I still have mqtt devices in yaml so this can still exist. I would start with the configuration.yaml then check any files that are included from there.

That is what the grep utility does.

Yep, I understand what grep does, been a Linux user for about 20 years. I would still check the files though as it seems something is still hanging around.
Good luck.

I would expect to find it somewhere in my config folder, typically in a yaml file, because it does exist and contains accurate information. But where is it defined?

I did a grep of . in my configuration folder and everything under it looking for “Dexcom” or “trend” or “val” and it never presents. It’s an interesting mystery.

Use the three dots in the top right and see if there’s an option for Device info.

Otherwise, try Entities and see what integration it comes from.

There is no option for “Device Info” in the meatball menu, only “Related”.

related

Clicking on that tells me that it is managed by the MQTT integration:

related2

Clicking on the right-arrow takes me to the MQTT integration:

And the sensor is not anywhere in the integration. Not in “devices” and not in “entities”.

Then either it came from MQTT Discovery or you’ve got it created from YAML, and it sounds like Discovery.

I have no issue with creating new sensors in ESPHome or in Node-Red or the Entities UI. My problem is that I rely on this missing sensor in automations and it is concerning that I can’t find where it is defined. What if a future core update deletes legacy entities that weren’t created through a UI or don’t have a unique ID?

No… FYI, there’s a stickied post that covers your concerns at the top of configuration section of the forums.

I suggest you read it as this is a fundamental part of HA and yaml based entities.

1 Like

With MQTT Explorer you can check if it is in the discovery messages.

If you look at my posts above, I have done exactly as the sticky says. Only that I do not get an edit window, I get:

edit entity

And this is exactly what I would expect for an entity created in yaml. And, as I have said, I can’t find the entity in any file in any folder in my config folders.

Right, that means the entity is coming from yaml or another method that does not supply unique_id. This means it will not show up in the traditional entity lists in the integrations page. Like the days of old.

As the great fountain of wisdom, Emily Litella said: “Never Mind”.

The trees were blocking my view of the forest.