Question. What is the design guideline for handling disconnected devices?

I have various integrations and they all act differently when a known device is not being detected. In most cases the logfile gets so many warning or error messages I filter them out. I am not asking for solutions here, but what SHOULD happen.

For example, I have Reolink cameras using the standard integration. I cut the power to them at night and then the logfile gets flooded with lines of code that have failed. My Denon AVR using Denon integration works fine when I turn the AVR off (to standby or completely off), but if HA is rebooted when it is already off the integration reports it as network error and constantly tries to connect.

HACS integrations Tapo and Local Tuya flood the logfile with failed code, but Meross reports a single line per device every 4 hours … to me that is a good compromise.

So what is the designers’ plan for handling devices that are currently not detected? Is there a document I can read about that subject?

1 Like

just a workaround, but it helps a little with my Denon AVR.
I have this in configuration.yaml:

# Logger - no errors when AVR reset
logger:
  default: error
  logs:
    homeassistant.component.media_player.denonavr: critical
    homeassistant.components.denonavr.receiver: critical
    DenonAVR: critical

I think it will be difficult to get agreement on this because of device manufacturer communication approaches and integration developers coding quality. There has been some thought about this given the integration quality scale:

It would be nice if all integrations were at the Platinum level.

Thanks MaxK, I think that is the sort of detail that answers what the goal should be.

For Silver integration quality, at the top it says:
“This integration is able to cope when things go wrong. It will not print any exceptions nor will it fill the log with retry attempts.”
And in the list a bit more specific:
“Handles device/service unavailable. Log a warning once when unavailable, log once when reconnected.”

That seems pretty clear to me that most of the integrations are failing the Silver quality test. So, with confidence I can raise these as bugs.

BebeMischa, thanks for the input. I don’t have excessive logfile entries for Denon. Maybe the integration has been updated since you created the workaround. But LocalTuya, Tapo and Reolink are a real pain, with multiple lines of code failure repeating constantly.
. I filter them out by checking for specific text. Only the first line is needed. Example:

filters:
  custom_components.tapo.common_setup:
    - "Failed to setup*"