🛡 Watchman - keeps track of missing entities and services in your config files

This plugin is perfect and should be standard for HA.
Thanks for sharing!

Can I modify the text for the notification? (e.g translate)

Also, if all is good, can I suppress the notification?

I also have a feature request :slight_smile:

There are many spelling errors or just beginners mistakes, that could be checked for.

  • if a state for covers is closed instead of ‘off’
  • common spelling errors such as 'off ’ or ‘Off’
  • and probably more

This would be extremely helpful and I think it could be done with the way the plugin operates.

1 Like

Hi @davinci, thank you for your feedback!

This will require some improvements to localization support, I will add it to the backlog.

When you call the service, you implicitly ask Watchman to send the report via notification channel (even when zero problems are detected). Nevertheless, using simple automation, one can send a report (notification) only when Watchman sensors have non-zero values.

I like the idea, let me check if this can be implemented without significant changes to Watchman architecture. AFAIK, knowledge about “valid” states for a sensor is encapsulated within its domain and can’t be easily retrieved by an integration. Probably we can introduce some heuristics which will mark some states as “suspicious” without 100% reliability.

That would be a great improvement. Maybe you can also catch this: a numeric_state on covers not having set the attribute to current_position (e.g. field was left blank) or using ‘on’ ‘off’ instead of ‘open’ and ‘closed’ for states.

Which is probably the number one reason why my automations fail :smiley:

I guess there are many such cases.

Is there an integrated way to ignore changes that are only there for e.g. less than 5 minutes?

For example some devices fail intermittently to send variables, but they work fine. Only if the error persists for more than 5 minutes I would consider this an issue that needs action. For now I use a time helper to check after 5 minutes if the issue is still present (missing entities > 0 or missing services > 0) and only then I send a notification.

Like this I will never get a “all ok” though. The reason for that is, otherwise I would get a message after five minutes each time I save an automation (because they are all reloaded, which triggers my time helper twice).

Could you please add support for this code type as well:

states.binary_sensor.motion.last_updated

not only state_attr('binary_sensor.motion','last_updated')

I think you may be lost. This has nothing to do with Watchman. Also your question is back-to-front.

You can’t access the property of the object like this:

state_attr('binary_sensor.motion','last_updated')

last_updated in not an attribute of the entity. It is a property of the state object. It can only be accessed by:

states.binary_sensor.motion.last_updated

See this post by petro for more:

1 Like

Ok, so I have to use states.binary_sensor.motion.last_updated.

This is why I asked to add a check for this kind of code in the plugin. Because right now it doesn’t check for that.

1 Like

Ah, now I understand what you were asking. I don’t know if this sort of yaml parsing is within scope of the project. I’ll let scr answer that.

I have some missing entities in lovelace, but I am not able to find them…is there a other to find them?

I found a few notes when running the report. Not sure if any of this is known (could not find references) or working as intended. Just passing along some info.

HAFloorplan

This integration has a Rules section in its config. Two things are messing with the report.

  1. The integration adds some services that are not identified by the report. Even though this is valid the report has it marked as missing.
action: call-service
service: floorplan.class_set
  1. A feature of this integration is mapping SVG elements to HA entities. It is common to name the SVG elements in the same convention as the HA entities. I have some that are not 1-to-1 mappings but rather several SVG elements map to a single HA element. However those are in the elements section and not the entities section and should not be reported.

Fully Kiosk

This integration allows for controlling a tablet used as a control panel from HA. One of the things it does is creates a media player entity for the tablet. This media player shows up in the configuration entities section and works as intended however the following shows as unknown.

  - service: tts.google_translate_say
    data:
      entity_id: media_player.my_control_panel
      message: "{{ message }}"

Home Assistant

It is possible to create a scene on the fly.

- service: scene.create
  data:
    scene_id: my_new_scene

However the report shows the entity as missing.

 - service: scene.turn_on
   target:
       entity_id: scene.my_new_scene

Hi I learned about this tool today, but I’ve an issue activating it. I installed vs 0.5 via HACS and rebooted HASS (a few times as a matter of fact). It does show in HACS as installed. No entries in any error log.

But, I cannot add the tool to my integrations.

I did remove the tool and reinstalled, but no difference (as I would not ask for help then).

So, what to check and/or do?

Great idea! I was just thinking the other day that over time how do i know I don’t have a bunch of garbage in my installation as it grows.

1 Like

I have been using this for a few days and I appoligize for my naivety in the use of this.
A few questions.
Can this be exported as a cvs file so I can open it in a spread sheet.
I am using VSC to read the file it seems very “squished” is there a way to expand the columns so most lines are as long as possible, like in the developer tools states.

Now my biggest wish for another time and place would be if there was some way that the error was linked to a file on how to fix the problems or more details on what might be wrong.

Thanks

Same problem here. Anyone found a solution?

Yes, installing an HASS update did it for me. I guess this cleared the cash of the browser I guess. Other advice I got was to clear the cash.

That totally makes sense, thanks for idea! I’ve added a ticket for this to the backlog.

The report should contain exact file name and line number where missing entry was found. These lovelace files are not intended for manual change, they’re basically json files used by the dashboard (ex-Lovelace) editor. Nevertheless, review of them may help to figure out which part of dashboard the missing entity belongs to.

The only idea I have is that report was created at the point in time when initialisation of some services/entities was not yet finished (e.g. after HA restart). This is especially true for integrations which are loaded asynchronously by HA, that is, the entities/services they provide become available after some delay. To validate this you can run the report once again and check the result.

Not yet.

Yes, check “Report’s columns witdth” settings.

I was thinking about hyperlinks to a file in the report. It seems that it should be somehow supported by the tool (file editor) used by the user. So far I see no portable solution.

1 Like

@scr That would make total sense however re-running the report just now had the same results and HA has been running for a couple of hours since my last restart.