Giter VIP home page Giter VIP logo

home-assistant-clean-entity-registry's Introduction

Clean home-assistant's entity_registry.yml

If you've added and remove alot of devices in Home Assistant, the entity_registry.yaml file can get pretty big with old unused entries.

I noticed that the api/states provided the currently used entities, so I decided to automate this tedious task.

Download or copy-paste the contents into a regenerate.php file.

Install php-cli (for example on ubuntu just run apt-get install php-cli)

Run the script with

regenerate.php /home/your-user/.homeassistant/entity_registry.yaml "http://your-home-assistant:8123/api/states" delete > output.yaml

now you can inspect the output.yaml and see if everyhing is ok, then replace the original file with this one ( please stop home assistant then replace the file then start it again to make sure everything is ok)

If you do not put "delete" at the end, the unneeded entities will be commented in the output file, instead of being removed.

Enjoy!

home-assistant-clean-entity-registry's People

Contributors

vladbabii avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

home-assistant-clean-entity-registry's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.