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
72.06k stars 30.18k forks source link

HA gets flooded with log entries and eventually crashes #112509

Open netizeni opened 7 months ago

netizeni commented 7 months ago

The problem

I'm having an issue with python miio integration, which I explained in this opened github issue on python miio repository. Integration itself works fine, but logs are getting flooded with:

[miio.device] Found an unsupported model 'zhimi.airp.mb3a' for class 'AirPurifierMiot'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/ [miio.miot_device] Unable to find mapping for zhimi.airp.mb3a, falling back to zhimi.airpurifier.ma4 [miio.miot_device] Unable to find mapping for zhimi.airp.mb3a, falling back to zhimi.airpurifier.ma4 [miio.miot_device] Unable to find mapping for zhimi.airp.mb3a, falling back to zhimi.airpurifier.ma4 ... [miio.miot_device] Unable to find mapping for zhimi.airp.mb3a, falling back to zhimi.airpurifier.ma4

Right now, there's more than nine thousand of same entries. HA constantly writes them to logs until it eventually crashes the app or becomes laggy and unusable. If miio intergartion is removed, HA works normally with no degradation of performances.

I assume the library owner is busy with something else, so until he sees the opened issue, I want to check is it possible to suppress only these two particular entries from getting written to logs? I'm aware of log level change, but I don't want to miss entries with the same level, if they appear.

What version of Home Assistant Core has the issue?

core-2024.2.5

What was the last working version of Home Assistant Core?

I can't remember, but some really old one from 2022.

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Xiaomi miio

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @rytilahti, @syssi, @starkillerog, mind taking a look at this issue as it has been labeled with an integration (xiaomi_miio) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `xiaomi_miio` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign xiaomi_miio` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


xiaomi_miio documentation xiaomi_miio source (message by IssueLinks)

rytilahti commented 6 months ago

This needs to be fixed in upstream, if it isn't already. As you have noticed, the code that homeassistant is using is different from what's in master, and the current code defines the mapping for this device.

For the time being and until a new release is out, I would suggest just changing the log level for that specific logger (miio.miot_device) as it's rather unlikely you will encounter any interesting messages from that specific module. I just released python-miio 0.6.0.dev0 a couple of days ago, to make it easier for external contributors to start porting their code over and to report any issues before the release, so I'm hoping we are going to get this fixed soon enough.

netizeni commented 6 months ago

Thanks! From the experience, what's the estimate time frame until the change gets merged to a new HA release?

issue-triage-workflows[bot] commented 3 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

netizeni commented 3 months ago

The issue is still present, can it be opened?

blankster commented 1 month ago

I still have the problem with the "Pro H" model; 3/3H works for me. Same behavior, latest HA Core. According to documentation, it should be supported, but I'm constantly getting:

 logger: miio.deviceSource: /usr/local/lib/python3.12/site-packages/miio/device.py:159First occurred: 3:37:16 AM (2 occurrences)Last logged: 3:42:03 AMFound an unsupported model 'zhimi.airp.vb2a' for class 'AirPurifierMiot'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/

 logger: miio.miot_deviceSource: /usr/local/lib/python3.12/site-packages/miio/miot_device.py:172First occurred: 3:46:26 AM (1 occurrences)Last logged: 3:46:26 AMUnable to find mapping for zhimi.airp.vb2a, falling back to zhimi.airpurifier.ma4

Since this issue has already cost me hours and there doesn't seem to be a working solution available, I might be able to save someone else some time by at least suppressing the warnings.

If the following is entered in the configuration.yaml, the warnings will be suppressed:

logger:
  default: warning
  logs:
    # Disable warnings for these devices
    miio.device: error
    miio.miot_device: error