Option to specify if device should be considered Permanently or Occasionally connected

Proposal
Add option to devices/entities so that Home Assistant doesn’t throw an error if the device is set to not be considered permanently connected.

Optional extra: Include an option to specify hour/minute/second to elapse before its actually considered a problem.

Scenarios:

  • We know a TV isn’t usually left on 24/7 and shouldn’t receive an error if it becomes unavailable due to it being manually turned off
  • Lights which may be dependent on other things or where they don’t need to be permanently communicating with Home Assistant

Which errors do you have in mind?
If an entity is not online, it should simply have a state of unavailable, not throw errors.

Not 100% sure what your goal is but I have a few esphome devices which are not permanently connected (for example a esphome dimmer after a esphome switch).

To avoid that the (offline) dimmer shows ‘unavailable’ on all entities it is enough to add ‘deep_sleep:’ to the esphome yaml without actually define any deep sleep periods. The connection status will always be correctly shown in HA.

This one:

Logger: homeassistant.components.androidtv.media_player
Source: components/androidtv/media_player.py:188
Integration: Android Debug Bridge (documentation, issues)
First occurred: 15:11:26 (1 occurrences)
Last logged: 15:11:26

Failed to execute an ADB command. ADB connection re-establishing attempt in the next update. Error: Reading from 192.168.1.103:5555 timed out (9.0 seconds)

@jordanhinks0 Don’t forget to vote for your own feature request.

@Stiltjack is an example of what I also have.

@koying based on what you’ve said I now believe that it would be a case where not all integrations are correctly setup, example as Stiltjack provided where Android and even Samsung devices would do this

Another example would be WLED as per below error:

Source: helpers/update_coordinator.py:322
Integration: WLED (documentation, issues)
First occurred: 12:31:26 (1 occurrences)
Last logged: 12:31:26

Error fetching wled data: Invalid response from API: Timeout occurred while connecting to WLED device at 10.0.30.112

Might this be a general problem with all integrations that only support polling?

I believe so based on @koying said before… so integrations need to improve error handling to check if the device is simply not available.

1 Like

Yep, exactly. I have the same (non-)errors when my android TV goes to sleep.
That integration should be smarter for sure because it knows the device will go to sleep or be turned off at times.

Not convinced it should be a generic option…

1 Like

Don’t agree. An error is an error. The integration should be updated to handle it if it’s expected behavior of a specific device

Yes we are considering this to be a problem, but not something to be added as a feature request as the devs behind each integration such as WLED and Android TV need to account for those devices not being on all the time.

In the case of Android TV, where the “error” is very specific, it might be better for the user to filter it out of the logs if she/he wishes (which is what I do). As @NathanCu says, an error is an error - not sure the developers can be expected to second-guess our usage.

Edit: And actually, come to think of it, Android is designed to be on all the time.

1 Like

All android devices go to sleep at some point, like most powered device really.
Now sleep can mean a lot of things, but it’s not uncommon for asleep devices to loose network connectivity…

Now, whether this specific error should be logged…
Thinking of it, I don’t see how the dev could make the difference between an actual error or the device going to sleep, so probably best to log too much rather than too little.

1 Like