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

Not sure if this is the place for suggestions but would be nice to have a config option to ignore disabled automations. e.g. if entity/device doesnā€™t exist for a disabled automation, donā€™t report it.

3 Likes
-== Watchman Report ==- 

-== Missing 6 service(s) from 94 found in your config:

-== Missing 274 entity(ies) from 608 found in your config:

Thanks for an awesome Integrationā€¦ but oh man Iā€™m going to be busy for a whileā€¦ :man_facepalming:

3 Likes

The search function in VSCode helps. Search all files in your /config directory for the missing things.

Yeah, well the report tells me exactly which line things are on in each file, plus I have all my config in packages so itā€™s pretty organised and easy to fix. Thereā€™s just a lot of them to go through.

First off, this is probably one of the best tools ever created for Home Assistant - it should be added as standard functionality in core. Thank you for this amazing work!

I want to create a notification where the message includes missing entities identified by the watchman service. Can someone help me with how this would be coded? I struggle with template documentation, so examples would be very helpful.

2 Likes

The easiest way would be to call Watchman service as shown in the picture. persistent_notification.create will display a persistent HA notification with Watchman findings, you can change it to any other notification service you have.


Please note that unlike the file report, ASCII table formatting is not used for notification service as tables will be screwed in most of the cases.

2 Likes

@scr do you think this could integrate with the new ā€œRepairsā€ feature?

2 Likes

I created this automation to notify me whenever an additional entity becomes unavailable. It has some additional features that the notify feature in Watchman lacks. It only notifies if the number of unavailable entities increases and stays increased for 30 seconds. That got rid of the nuisance alerts for me.

alias: Notify of unavailable entities
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.watchman_missing_entities
condition:
  - condition: template
    value_template: "{{ trigger.from_state.state | int < trigger.to_state.state | int }}"
action:
  - service: watchman.report
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
  - condition: template
    value_template: >-
      {{ trigger.from_state.state | int <
      states('sensor.watchman_missing_entities') | int }}
  - service: hangouts.send_message
    data:
      target:
        - id: abc123
      message:
        - text: Entity Unavailable
mode: single
3 Likes

So, I just have installed this supermegacooltool :wink: and want to say thank you @scr for the effort.
Excellent!

And, it did run.

So I have:

Domain Count
Automation 67
Binary Sensor 234
Button 41
Calendar 7
Camera 1
Climate 4
Cover 3
Device Tracker 36
Group 1
Input Select 1
Light 10
Media Player 23
Number 12
Person 4
Remote 3
Scene 34
Script 30
Select 12
Sensor 837
Sun 1
Switch 56
Timer 2
Update 15
Weather 6
Zone 12

and Watchman found 2 errors. One misspelled entity in automation, one entity mentioned in scenes, which has been renamed by reinstall of integration later.

2 only! Actually Iā€™ve immediately got proud of myself :smiley: My own effort on clean administration has worked. This gives confidence :smiley:

3 Likes

Hi,

Seems that decluttering templates are not handled correctly as sensors are being reported as missing. Is it the case?

e.g.:

            - entity: sensor.anniversary_person[[person]]_birthday
              name: Birthday

missing

| sensor.anniversary_person      | missing | dashboards/house.yaml:14                                     |
1 Like

Have the same every time. But i know the automation is working so its fine for me :slight_smile:

Iā€™ve excluded the dashboard yaml files as my target is to have 0 issues to allow identify real issues. Hope templating will identify by watchman in the future

1 Like

I canā€™t seem to add the integration after installing it. I have restarted and it shows up when I try to add integration, but then only spins on ā€œplease wait while watchman is being setupā€ and then fails. Anyone have had the same problem?

1 Like

I think thereā€™s a bug. It shows


 sensor.general_waste [missing] services.yaml

of the garbage addon

And person.name [unknown] lovelace.lovelace_home

the person just doesnā€™t have a phone/location thatā€™s all.

ā€œMissingā€ means sensor has not existed in the HA registry at the moment the report was created. Is there sensor.general_waste in the Developer Tools->State List? Please note that when Watchmanā€™s report invoked before addon of integration is fully loaded, their sensors may not yet exist in the registry.

Please create a ticket on the github if issue still exists. Besides error message from log Iā€™d need a part of configuration file Watchman complains to (single line would be enough).

No it doesnā€™t. This has been here for weeks, so not sure whatā€™s going on. Not sure if my garbage addon isnā€™t right.

image

I was wondering if someone ever successfully managed to transfer the markup card from the docs to use with

I prefer flex-table-card a lot but I canā€™t access the entities attributes elements.

Can someone help on this?

What I got:

type: custom:flex-table-card
title: 'Watchman: fehlende EntitƤten'
clickable: true
entities:
  include: sensor.watchman_missing_entities
columns:
  - name: ' ID'
    data: id
    modify: ''
    prefix: ''
    suffix: ''
    align: left
    icon: null
  - name: ' Status'
    data: state
    modify: ''
    prefix: ''
    suffix: ''
    align: left
    icon: null
  - name: ' Ort(e)'
    data: occurences
    modify: ''
    prefix: ''
    suffix: ''
    align: left
    icon: null
sort_by:
  - id+
  - state+
card_mod:
  style:
    $: |
      .card-header {
        font-size: 18px !important;
        font-weight: bold !important;
        padding: 5px !important;
        padding-top: 0px !important;
        margin-left: 20px;
        margin-bottom: -20px !important;
      }

grafik

flex-table-card/docs/example-cfg-data.md at 779a9f6344f99e180bdab5fa83df2c6be8c878b0 Ā· custom-cards/flex-table-card Ā· GitHub is referencing

When accessing attributes, sometimes an attribute object will itself contain objects. In that case, you can access the lower object using dotted notation. eg: object1.object2.field1

But using data: entities.id doesnā€™t work eitherā€¦ :frowning:

services.yaml is an example file generated by integration owners, so entities inside it probably do not exist in your system, you should exclude it.

Thanks. Am I doing this right?
image

It still shows after run
image

This is how i setup