dummylabs / thewatchman

Home Assistant custom integration to keep track of missing entities and services in your config files
MIT License
453 stars 18 forks source link

Feature request - Know where an entity or service is used - #66

Closed RASBR closed 1 month ago

RASBR commented 1 year ago

Hello, This is really great, but I think it would be even greater if the user can use it to know where an entity or service is used?

Thank you R.S

filmgarage commented 1 year ago

If you add the Lovelace card to your UI you can hover over the file name where an orphaned entity is located and the pop-up will even show the line number in the file. Or is that not what you are looking for?

filmgarage commented 1 year ago

Here is an example:

Scherm­afbeelding 2023-02-05 om 23 38 33

Hovering your mouse over the word automations.yaml shows this entity was referenced on the lines 1774, 1781, 1791 and 1804 in automations.yaml

RASBR commented 1 year ago

I didn't pause the mouse over before, this is really helpful.

Thank you very much. R.S.

bcutter commented 1 year ago

How to "hover" on touch devices like smartphones by the way 😀

filmgarage commented 1 year ago

You can hover as long as you like, but nothing will happen I'm afraid... 😂

bcutter commented 1 year ago

For sure. That's why building UI relying on features only available on a certain type of devices is... oldschool 😎

filmgarage commented 1 year ago

You may want to file a feature request to make these file names "clickable" and show the line number. Personally I prefer repairing these issues on my laptop anyway. It's too cumbersome on my mobile.

ProfDrYoMan commented 1 year ago

Line numbers are nice, but do not help a "GUI" only user. Would it be possible to show the name of the automation that is containing the troublemaker?

filmgarage commented 1 year ago

I came across this in the readme section:

"4. To display line numbers in the report just remove .split(':')[0] from the card template"

If you do so you don't have to hover over the file name anymore.

dummylabs commented 1 month ago

I like the idea to extract automation name from the yaml, although I’m uncertain about its ease of implementation. Added #140