Gracefully handle temporarily missing devices

Please can you add a method of gracefully handling smart devices that are expected to be regularly missing from the network?

I expect the main use case for this to be devices like smart TVs and similar which get routinely switched off at the wall or remotely powered down, causing a flurry of error messages in the Home Assistant log. In my case, I have have several smart plugs that are automated to turn off smart TVs, consoles, soundbars, network gear, etc. overnight or when I am on vacation, saving a large amount of standby power. The same feature might also be useful for portable devices that are physically removed from the home.

What I am imagining is a service that could be used to dynamically disable and re-enable devices before you shut them down, so that their integrations stop trying to poll them or log the resulting error messages when they cannot make contact. Some considerations:

  • The feature should work per device, rather than per integration, as there might be other devices present that use the same integration but are not switched off.
  • The feature should not interfere with integrations auto-detecting new devices.
  • The feature should not totally disable logging for the whole integration, or for the target device at other times. We still want to see unexpected errors and warnings.
  • This feature could be added to individual integrations separately, but it might be more elegant to implement it in the core of Home Assistant, so that it could work with any type of device. In my case, the Android TV, Google Cast, Sony Bravia TV and Sony Songpal integrations are all relevant. A halfway house could be to specify a standard service name that integrations could choose to provide.
  • If it is not feasible to implement a feature to dynamically disable devices, a compromise might be to allow logging for specific devices to be dynamically enabled and disabled.

Thanks for considering this!

Good luck with your request.

You can currently manually disable an entity and it works. What usually fails is re-enabling it. It will only re-enable after restarting Home Assistant.

I reported this bug in January (for the second time; the first time was six months earlier) and have kept the Issue open but it remains unsolved. Given its age, it’s clear that no developer is interested in fixing it.

Until it’s fixed, a service to enable/disable entities is likely to encounter the same problem. It will probably be able to disable an entity but fail to re-enable it until Home Assistant is restarted.

I have added my vote, I am researching a similar situation: often I switch off the power to a device with home assistant, so what I would love to have is the possibility to definene a relation: if switch.relay1 is off, then light.behindrelay1 can’t ever be on, give up trying, just make it a light shade of grey in the UI.

FWIW, I want service calls to:

  • hide and unhide entities
  • enable and disable entities

My use case it probably quite common. I have a number of smart switches, plugs, etc. that I only use during the holidays. I have an input_boolean for “Holiday Mode”. When holiday mode is enabled, I enable a number of automations, when i disable holiday mode I disable those automations.

However, that leaves a lot of unavailable entities and devices (because I take them down and put them in boxes). I’d like to be able to disable and/or hide them.

I frankly don’t care if I have to restart HA to get the devices back, what I’m trying to avoid is manually searching for them all in the UI, then enabling them all. I’d like to…you know…automate that? Additionally, there is already a service call to restart HA, which could easily be placed AFTER service calls to enable your entities.

1 Like

I, too, would love to have service calls for enabling and disabling entities/devices. I was trying to write an automation to do that tonight and was shocked there was no way to do this already. I’ll put in a separate feature request for this.

Well yes that’d be perfect. Ultimately, I’d like to connect a switch to one or many integrations, devices or entities via the UI (maybe using groups) and then be able to define another input boolean to automate.

My example usecases are: when weather is good (summer) my floor heater will be offline for a long time (hw turned off).

another:
when bedtime, every day, my switches turn off, so the airpurifer integration toggles off with the switch . In the morning it turns on. (Btw Airprufier time to boot is XX sec so ideally one could specify integration start offset XX seconds.)

My use case is localtuya and a BBQ temperature probe that is wireless. It (of course) has an IP address but naturally it is only used maybe once a week or so, the rest of the time it is off. I normally disable the integration but forgot to do so last night, this morning shows the log:

Logger: custom_components.localtuya.common
Source: custom_components/localtuya/pytuya/__init__.py:669
Integration: LocalTuya ([documentation](https://github.com/rospogrigio/localtuya/), [issues](https://github.com/rospogrigio/localtuya/issues))
First occurred: June 23, 2022, 6:12:41 PM (825 occurrences)
Last logged: 9:43:43 AM

825 pings to the device. Now it isn’t that big a deal but it certainly would be nice to have a button in Lovelace in the GUI to enable/disable that device to make it easier to remember to do it (instead of going to the Settings->Devices and Services->LocalTuya->Disable