home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.48k stars 30.69k forks source link

Unable to (find a way to) Exclude ZHA Events from Logbook #84590

Open teskanoo opened 1 year ago

teskanoo commented 1 year ago

The problem

Since I switched from Deconz to ZHA, my logbook is overrun with entries created by the ZHA Integration

I have found no way to prevent these entries from appearing in the logbook (which makes the logbook very difficult to read)

image

Having over 100 Zigbee devices this results in the Logbook consisting of about 70-75% ZHA Events with the remaining 25-30% being those events in which I have expressed an interest in being reported

I have attempted to exclude ZHA events in the logbook configuration by domain


logbook:
  exclude:
    domains:
    - zha

I have attempted to exclude ZHA events in the logbook via recorder configuration where I can exclude event_types

recorder:
  exclude:
    event_types:
    - zha_event
    - zha.zha_event

Recorder config, IMO, should be the solution to remove these logbook entries - I can only imagine that I am targeting the wrong event_types, however this is how they appear in my (MariaDB) Database

I have attempted to prevent the logging in logbook by reducing the logging level for the integration (in the vain hope that this might be a factor)

logger:
  default: info
  logs:
    homeassistant.components.zha: critical

I have verified that this issue occurs regardless of the Enable/Disable debug logging setting for the integration

image

I have attempted to identify in the codebase if and where any recorder and logbook exclusions are taken into consideration when the deciding to log into the logbook

What version of Home Assistant Core has the issue?

2022.12.8

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ZHA, Logbook

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zha/

Diagnostics information

No response

Example YAML snippet

Snippets from recorder and logbook configurations that I have tried to exclude these events from the logbook

recorder:
  exclude:
    event_types:
    - zha_event
    - zha.zha_event

logbook:
  exclude:
    domains:
    - zha


### Anything in the logs that might be useful for us?

_No response_

### Additional information

Forum post concerning this matter (which has been  present since August 2021 but has not, as far as I can see, been raised as an issue)

https://community.home-assistant.io/t/exclude-zha-events-from-logbook/452501/13