Your Dwelling Assistant server could also be haunted. Not by precise ghosts, however by ghost gadgets and entities that present up in Dwelling Assistant even after the machine or integration has been eliminated. The excellent news is which you could bust these ghosts with no need to put on an unlicensed nuclear accelerator in your again.

How ghost gadgets occur within the first place

While you first get started with Home Assistant, it is easy to get excited and begin including each attainable machine you’ll be able to. Dwelling Assistant will usually robotically determine good dwelling gadgets in your community and counsel that you simply join them. Earlier than you recognize it, you’ll be able to have a whole lot of gadgets and entities.

Over time, chances are you’ll begin to take away good dwelling gadgets that you simply’re not utilizing, or Home Assistant integrations that you simply not want. Within the course of, chances are you’ll fail to delete some undesirable gadgets and entities, which hold round regardless of not being tied to any integrations or automations.

The Home Assistant Green smart home hub surrounded by smart home devices. Credit score: home-assistant.io

Ghost devices and entities also can come from utilizing an MQTT broker. If a tool publishes information with the retain flag enabled, the dealer will hold the final payload and resend it after Dwelling Assistant reconnects. In case you’ve since eliminated the machine, this stale information could make it look like the machine nonetheless exists.

Different potential sources of ghost gadgets are points reminiscent of failed Z-Wave pairings. When the pairing fails, the Z-Wave controller should register a node in its inner database that Dwelling Assistant then exhibits as an unavailable machine. They can be brought on by Matter devices being shared throughout programs, reminiscent of Amazon Alexa and Dwelling Assistant. In some shared setups, deleting a tool from one controller would not all the time take away it in every single place, so gadgets might nonetheless hang-out your Dwelling Assistant occasion.

Discovering ghost gadgets and entities

The primary place to search for ghost gadgets and entities is within the “Units & providers” part of the Home Assistant settings. You should use the filters that will help you spot entities that do not appear to belong to something you continue to use in Dwelling Assistant.

Go to Settings > Units & providers and click on the “Entities” tab on the prime of the display. Click on the filter icon, choose “Standing,” and test the containers for “Unavailable,” “Unmanageable,” and “Not Offered.”

Look by means of the outcomes for any entities that you do not acknowledge or which are linked to integrations that you have eliminated. Not the entire outcomes will likely be ghost entities; some might merely have misplaced connection or require the mixing to be reauthorized. It’s also possible to see which integration created the entities.

In case you do spot entities that you do not acknowledge and suppose they might be ghosts, do not delete them right away. Make an observation of all of them, in addition to the integrations that created them, earlier than doing all your due diligence.

Do a security audit earlier than you delete something

Cleansing up ghost gadgets and entities is a good suggestion as a result of they’re serving no goal apart from clogging up your Dwelling Assistant occasion. Earlier than you begin deleting every part you could find, you need to take a couple of precautions.

Firstly, take a backup of the present state in order that if issues cease working, you’ll be able to roll again to a working state. Make an observation of every part you propose to delete, so you’ll be able to restore out of your backup, and go away sure gadgets and entities in place if issues go improper.

Home Assistant running on a MacBook Air. Credit score: Adam Davidson / How-To Geek

Search by means of something that may depend upon the entities you are aspiring to delete, reminiscent of automations and scripts. Check out any dashboards that will additionally reference these entities.

Test the historical past for potential ghost gadgets to see the final time that one thing modified or up to date. If it was up to date lately, it might not be a ghost in spite of everything; it could simply be briefly unreachable. In case you’re not sure, you’ll be able to all the time choose to disable gadgets somewhat than delete them, to see what breaks.

It is time to bust some ghosts

When you’re sure that you have discovered some ghosts, you’ll be able to attempt to take away them. One of the best place to begin is with any undesirable integrations; eradicating these ought to do away with any related gadgets and entities, though this may occasionally not all the time be the case. You possibly can delete undesirable integrations by going to Settings > Units & providers, choosing the mixing, clicking the three dots icon, and choosing “Delete.”

The subsequent step is to delete any problematic gadgets that you simply famous down which are nonetheless displaying up. This could take away the machine and any related entities. Go to Settings > Units & providers and click on “Units” on the prime of the display. Click on the choice mode icon and choose the gadgets you need to delete. Click on the three dots icon and click on “Delete chosen.”

It’s possible you’ll discover that the “Delete chosen” possibility is grayed out. This could occur if the mum or dad integration remains to be energetic, or your machine is hard-coded in your configuration.yaml file. Some integrations might require you to take away the machine from the seller app earlier than you’ll be able to delete it in Dwelling Assistant.

Lastly, delete any ghost entities in the same method. Go to Settings > Units & providers and click on the “Entities” tab. Click on the choice mode icon and choose the entities you need to delete. Click on the three dots icon and choose “Delete chosen.” Your ghost entities ought to disappear like a full-torso vapor apparition getting sucked right into a containment lure.

Bustin’ ghosts the straightforward method

If all of this looks as if a whole lot of arduous work, you are not the one one who feels that method. So did Frenck (Franck Nijhof), considered one of Dwelling Assistant’s contributors. He wrote the Spook custom integration that may, amongst many different issues, determine ghost gadgets and entities and proactively warn you about them. You could find details about orphaned entities discovered by Spook by going to Settings > System > Repairs.

Unknown entities identified by the Spook custom component in the Home Assistant repairs settings.

There’s even a Spook motion you should utilize to robotically delete all orphaned entities, which immediately removes each entity that’s not claimed by a mum or dad integration. You possibly can set up Spook via HACS, though it isn’t an official Dwelling Assistant integration, and you utilize it at your individual threat.


The longer you utilize Dwelling Assistant, the extra probably it’s that you’ll find yourself with ghost gadgets and entities haunting your system. Cleansing them up can really feel fairly satisfying, as a result of in spite of everything: bustin’ makes me feel good.


Source link