Im using this integration many many times. Will it even be able to create a âWatchman unusedâ version?
A new integration that checks if entities created by users like sensors, binary_sensors, groups, manual lights, switches⌠all domains⌠not used in automations anymore.
Sometimes I check al my created things (testing here testing there, try to create something nice, but not work) and then you have leftovers that not used anymore.
Would be so nice to see a list of all domain entities that are not used. So you can remove them easierâŚ
I changed some settings to exclude custom_components. After a restart I got this error:
The system cannot restart because the configuration is not valid: Invalid config for [watchman]: expected a dictionary for dictionary value @ data['watchman']. Got 'w'. (See ?, line ?).
How can I fix this? Where is this invalid config? I canât configure from the UI anymore.
I am trying to get the markdown cards working.
I was able to get the missing entities showing up, but the missing services is not.
I am using the code as is:
Hi,
very good tool, I like it very much (Great work by you!).
Have you think about checking the node-red-flows, too? Iâm using only NR for all my automations and therefor it would be very helpful if there is a NR-watchman-checker on board.
I have added a few things to make my Watchman Card more helpful to me:
Tracking the number of ZWave Devices alive vs. connected.
Tracking the number of Zigbee2MQTT devices.
sensor.yaml
- platform: template
sensors:
count_zwave_devices:
friendly_name: 'ZWave'
icon_template: mdi:z-wave
value_template: >
{% set total = states|selectattr('object_id', 'search', 'node_status')|list|count %}
{% set dead = states|selectattr('object_id', 'search', 'node_status')|selectattr('state', 'in', 'dead, unavailable, unknown') | list | count %}
{{ total - dead }} Alive/{{ total }} Total
count_zigbee_devices:
friendly_name: 'Zigbee'
icon_template: mdi:z-wave
value_template: >
{% set entities = integration_entities('mqtt') %}
{% set ns = namespace(unique_ids = []) %}
{% for entity in entities %}
{% if device_id(entity) not in ns.unique_ids %}
{% set ns.unique_ids = ns.unique_ids + [device_id(entity)] %}
{% endif%}
{% endfor %}
{{ ns.unique_ids | count -2 }} ## -2 was added for my config to be accurate, yours will differ. i have 2 mqtt devices that are not zigbee
Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/watchman/__init__.py:422
Integration: Watchman ([documentation](https://github.com/dummylabs/thewatchman), [issues](https://github.com/dummylabs/thewatchman/issues))
First occurred: 2:37:59 PM (2 occurrences)
Last logged: 2:38:31 PM
websocket_api script: Error executing script. Unexpected error for call_service at pos 1: the JSON object must be str, bytes or bytearray, not dict
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 451, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 684, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1808, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1845, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/config/custom_components/watchman/__init__.py", line 240, in async_handle_report await async_report_to_notification( File "/config/custom_components/watchman/__init__.py", line 422, in async_report_to_notification data = {} if service_data is None else json.loads(service_data) File "/usr/local/lib/python3.10/json/__init__.py", line 339, in loads raise TypeError(f'the JSON object must be str, bytes or bytearray, ' TypeError: the JSON object must be str, bytes or bytearray, not dict
Is there a way to set up an automation that run only when one specific entity is marked as unavailable or missing? Iâve tried using the following as a conditional template â{{ âcamera.netatmo_cameraâ in state_attr(âsensor.watchman_missing_entitiesâ, âentitiesâ) }}â but it is always false event when camera.netatmo_camera is listed under ID in state attributes