šŸ›” Watchman - keeps track of missing entities and services in your config files

Hi,

I tried installing The Watchman and recieved the below error:

    https://github.com/dummylabs/thewatchman is not a valid add-on repository

Iā€™m running 2023.5.3

How did you install it? I have watchman and I didnā€™t need to add a repository to my add-on repositories.

From the github link you provided:

Quick start

  1. Go to the ā€œIntegrationsā€ section on HACS, click ā€œExplore and download repositoriesā€ and search for ā€œwatchmanā€, then click ā€œDownload this repository with HACSā€.
  2. Restart Home Assistant, go to Settings->Devices and Services->Add Integration and select Watchman integration. If integration not found, try to empty your browser cache and reload page.
  3. Go to Developer Tools ā†’ Services, type watchman and select Watchman: report service then press ā€œCall Serviceā€ button. Check watchman_report.txt file in your configuration directory.

Watchman is not an add-on. Itā€™s an integration.

you install it thru HACS and not the add-on store. HACS does not provide add-ons, only integrations.

Thanks ! Iā€™m new to HA and didnā€™t have HACS installed. I just did so and was then able to get Watchman installed as well.

Thank you, here is a bit modified version:

type: custom:flex-table-card
title: Watchman Missing Entities
entities:
  include: sensor.watchman_missing_entities
columns:
  - name: Entity
    data: entities
    modify: x.id
  - id: id_state
    name: State
    data: entities
    modify: x.state
  - name: Occurrences
    data: entities
    modify: x.occurrences.split(':')[0]
  - name: Lines
    data: entities
    modify: x.occurrences.split(':')[1]
sort_by: id_state

I myself prefer sorting by the ā€œOccurrencesā€ column:

    sort_by:
      - id_state
      - id_occurrences ##add this key to the corresponding column

Also, for me ā€œOccurrenceā€ is needed only for missing entities, then it may be done by this:

      - id: id_occurrences
        name: Occurrences
        data: entities
        modify: >-
          if(x.state == 'missing')
            x.occurrences.split(':')[0]
          else
            ''
      - name: Lines
        data: entities
        modify: >-
          if(x.state == 'missing')
            x.occurrences.split(':')[1]
          else
            ''

Also, for me it is better to have 3 separate lists for unavailable, unknown, missing; registered a FR for this.


A small remark: noticed a small assumption (absolutely not critical): only one ā€œoccurrenceā€ is reported for an ā€œentityā€, but an ā€œentityā€ may have several ā€œoccurrencesā€ (i.e. several files). Absolutely unimportant: a user may ā€œcleanupā€ missing entities in reported files, then ā€œre-watchā€ and check other files from a new report.

4 Likes

@scr, this is fantastic!

if my notification service is an email, what do I put in this section - just to show the whole report in the body of the email?

image

Thanks for any help in advance!

Iā€™ve been moving some of the yaml based items to helpers, but now I start to wonder: Does Watchman also report on helpers with missing entities, for instance a Threshold helper, template helper, etc with missing entities?

Depends on if Watchman monitors the ā€œcore.config_entriesā€ file.
In my observations, Watchman does not see when a new shiny UI-based template sensors become unavailable.
Off-topic: for me, see zero reasons to move my setup to UI-based helpers / templates.

Well, to give an example: I use thresholds a lot (is it dark outside so lights should go on and stuff like that). From the UI the threshold limits are accessible via the gui and do not require a restart when limits are changed. Also, they get displayed with the device they are linked to, it represents there as an entity same as the original ones. This makes navigation to those entities easier. And they can be assigned to an area, while the config version could not because it didnā€™t allow for a unique id.

1 Like

Yes, there are SOME advantages of UI-based config - but there are disadvantages as well, and for me the latter is more important now.
Sorry for off-topic.

Just looking at my Watchman integration
http://homeassistant.local:8123/hacs/repository/455174197
the graphics are missing.

This is a great tool, it really comes in handy when I am trying to rationalise entity names.

Is there a way with manually or using watchman to know if any entities used in the ui are missing?
ā€“ I typically decide to rename an entity, run watchman and see what it finds and then have to manually check all the dashboard pages for entity missing errors.

Posting internal addresses is useless. People cannot see what you wish to show them.

If your UI is defined in YAML, then yes, it will check that.

I know that - are the graphics missing in your integration too?

Why do I get these errors from Watchman ?

image

Look at the state of those entities. It will be ā€œunknownā€.

Iā€™m using the standard dashboard elementsā€¦

Better to post a screenshot of what you see.

You have to enable UI parsing in the integration settings.

1 Like