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

I get always the error:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 537, in handle_manifest_list
    raise int_or_exc
homeassistant.loader.IntegrationNotFound: Integration 'watchman' not found.

But it’s not installed.

What can I do?

What are you trying to do? Identify the unavailable spotlight?

I have this report
image

Can the blue be made links or clickable or somehow useful to find the file?

In this case it’s wrong, it’s from

That would be a question for the maintainer. One’s config can be structured in many ways: UI-only, which puts it in JSON in internal storage, or various YAML structures.

EDIT: Clarification: Watchman of course works with YAML specifically, so my JSON comment really isn’t relevant. I don’t know how Watchman’s internals work, but I would image it knows which file it is processing. Creating a local link for a browser seems like a security risk.

I cannot speak to this either, but I exclude ā€œentitiesā€ specified as defaults or in examples.

This is part of custom:auto entities (scroll to bottom for the example).

I’m a bit late to this, but you can also suppress tap_action (albeit nothing happens when you press anyway):

filter:
      template: >-
        {%- for item in
        state_attr("sensor.ha_prod_watchman_missing_entities","entities") -%}
          {{
            {
              'type': "custom:mushroom-template-card",
              'entity': item.id,
              'primary': item.state + ' ' + item.id,
              'secondary': item.occurrences,
              'icon_color': "red" if item.state == "missing" else "orange" if item.state == "unavail" else "yellow",
              'icon': "mdi:cloud-alert" if item.state == "missing" else "mdi:cloud-off-outline" if item.state == "unavail" else "mdi:cloud-question",
              'tap_action': "action: none"
            }
            }},
        {%- endfor -%}

I am pleased to announce that version 0.6.4 has been released and is now available in HACS. Change list is available here: Release v0.6.4 2024-11-23 Ā· dummylabs/thewatchman Ā· GitHub

3 Likes

Urgent Call!

the entities sensor now shows up input_button helpers as unknown state , must fix!

Regards

unknown state of input_button will be ignored in the next version of WM.
Ticket: input_button always reported as unknown Ā· Issue #173 Ā· dummylabs/thewatchman Ā· GitHub

getting false alarms now on templates with this:

          {% set event = vj_marijn %}
          {% set year = 1 if event.month < now().month or
                            (event.month == now().month and event.day < now().day)
                         else 0 %}

Watchman reporting

the latter event is used in

  - id: folder_watcher_config
    mode: queued
    max_exceeded: silent
    triggers:
      - trigger: state
        entity_id: event.folder_watcher_config
        attribute: event_type
        to:
          - created
          - deleted

so seems an oddity too? this one is an actual event, the others are variable names … (I could probably fix that using non reserved word there…)

update

And yes, after renaming the variable names to non reserved words, those disappear from the report;

the folder watcher remains though (it really shouldnt) and the backup mentions are regulars, the integration seems to take a while before those entities are created, I guess I could whitelist those 2. Especially since they’re on the same page as the card for the Backup integration itself :wink:

btw see those state there? they’re also made by that integration ands not correctly translated by the frontend somehow… device_class playing up there

Right, it seems very similar to date.* issue.

Update: Since events do not have persistent states besides unknown, they should be removed from the watching list. This will be addressed in a future fix. Not sure about date.* yet.
Sorry for the inconvenience.

thx, I did add the info to that issue.

Should I write it up separately?

No, I’ve published a beta 0.7.0 to HACS which should resolve issues with date and event entities.

Trying to run watchman.report, I get an error:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:315
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 07:54:12 (1 occurrences)
Last logged: 07:54:12

[139757406392608] Error handling message: Unable to write report: [Errno 2] No such file or directory: ā€˜ā€™ (home_assistant_error) Jxxxxx Lxxxxx from (IP address) (Mozilla/5.0 (Linux; Android 14; OPD2203 Build/UKQ1.230924.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.6723.107 Safari/537.36 Home Assistant/2024.10.3-14058 (Android 14; OPD2203))

The one thing I see is that the Redacted (IP address) is incorrect.

I am getting the same error on 2025.1, however the persistent notification works. There is no report file been written to the file system.

Happened to me too. You need to specify a path for the report to be generated using the Watchman configuration.

HA → Settings → Devices & services → Watchman → Configure

1 Like

Probably related. I use event.value_notification in triggers to hook button presses on Zooz devices

+--------------------------------------------------------------+---------+--------------------------------------------------------------+
| Entity ID                                                    | State   | Location                                                     |
+--------------------------------------------------------------+---------+--------------------------------------------------------------+
| event.value_notification                                     | missing | automations.yaml:40,51,62,73,84,95,209,220,524,535,546,557,5 |
|                                                              |         | 68,691,702,1177,1188,1247,1257,1436,1447                     |
device_id: 122412xxxxxxxxxxxxxxxxxxxxxxx
domain: zwave_js
type: event.value_notification.central_scene
property: scene
property_key: "001"
endpoint: 0
command_class: 91
subtype: Endpoint 0 Scene 001
trigger: device
value: 0
id: Up Once

It is valid on devices. not sure how I can make it show valid for report

Is there a way to use this integration to display the availablity history of entities? For example, I have the following history graph set up for an entity, which effectively shows its availability:
image
Unfortunately this approach won’t work for most entities. It would be great to show a list of important devices/entities and their historic availability to help identify problems with the integration or network.

Why do you need it from Watchman? The built-in history chart will already show when an entity was unavailable.

1 Like

That’s what I’ve done for the entity shown above, but I must be missing something, if I do the same with something like a temperature sensor, I get the history of the temperatures, not the availabililty state of the device. It’s probably something simple I’m missing, but I can’t see what.

Right, so we’re talking about numerical entities specifically – not binary sensors or categorical values.

I think in that case you’ll need to make template binary sensors using the has_value template function. Other way, if you’re interested in devices, is to use device trackers (like ping sensors, or a network integration, etc.).