Automation to disable/enable entity?

Is there a way to make an automation to disable an entity? for example when I turn of the light to disable the yeelight lamp?


Saw you didn’t get any responses. I’ve come here to find out the same thing.

My use case is that I have a bunch of outdoor switches that I use during the holidays. I don’t want them to show up in my UI anywhere when it’s NOT the holidays. So, I’d like to be able to disable them with an input_boolean and re-enable them when it is the holidays.

From what I’ve found, you can only enable/disable via the UI. You can probably write a script to do it by editing the entity database, but probably not for the feint of heart.

1 Like

I’ve got same problem. As a workaround to put my TV in sleep mode I have to disable the polling of the API for at lease 2 minutes, I can accomplish this by disable the (2) entities the integration provide, but unfortunately I can do this only on the GUI and not with a “service”.

There is no way to do this

Good idea though. It would be pretty handy to have a service to disable/enable an entity. Both for this use case as well as being able to write a quick script to disable or enable entities in bulk (a very frustrating task today).

Can you add this as a feature request?

I agree, it would be nice to have this.

The only caveats I see are that the entity_id won’t be in the states machine when it’s disabled, so this might be something that’s easier said than done. I could see this making it limited to things that are in the registry with a unique_id.

I’d also like a service to disable entities. My reason is the new Inovelli Blue Zigbee switch creates over 100 entities for each switch (using Zigbee2Mqtt). I’d like to disable most of those.

Could this be done using the REST API or similar? Could this be done using a custom integration that exposes a single service?

This would be great. I have my air conditioners connected to HA via MEL Cloud. In winter I disconnect the breakers of the AC, so my HA log is showing continuously errors coming from MEL CLoud integration as it cannot connect with the machine.
In addition, the climate entity does not refresh, so the the temperature is locked at the last temperature registered in September, so when I ask Alexa, the mean temperature that it gives me is not the real temperature.
I would like an automation so when I activate “winter mode” (a switch), HA disables MEL Cloud integration.

1+ on this feature request. Here’s my use case:

My child has 2 gps trackers attached to her ‘person’, a phone tracker, and an Apple Watch tracker. When she goes to school, she wears her watch, but leaves the phone at home. While she’s at school, her person geolocation alternates between school and home. I want to make an automation that will use the Apple Watch tracker to trigger disabling the phone tracker when she enters the school zone. Then an automation to enable the phone tracker when she leaves school.

Just build a template sensor that uses the gps attributes based on those conditions. Then attach that to her person.

Thanks petro. I’ve been meaning to learn templating, but just haven’t gotten there yet. Is this something I need to do via yaml, or can I do it via the UI with a helper?

I have the exact same use case for those inovelli blues.

I went ahead and created a HACS integration that provides general service for updating entity configs at GitHub - amosyuen/ha-registry: Adds services for home assistant registry operations.

I also created a script that uses it to configure my inovelli blues. Home Assistant Configure Inovelli Blue Script · GitHub

1 Like

I believe this is now possible using Frenk’s Spook HACS custom component