Test deployment available here: https://homeassistant-renamer.vercel.app/
The Home Assistant Entity Renamer is a Django-based web application designed to manage and rename entities in Home Assistant. This tool provides a user-friendly interface to list, filter, and rename entities using CSV files or regular expressions, enhancing the organization and management of Home Assistant configurations.
Upload a .csv file to rename entities.
- Entities: Represent Home Assistant devices or objects that users can rename.
- Renaming: The core functionality allowing users to update entity IDs and friendly names.
-
Access: Navigate to the home page with a login option to access the main functionalities.
-
Authentication: Sign up for an account or log in to access the Home Assistant Entity Renamer dashboard. Needed to store your homeassistant details.
-
Dashboard: Main interface displaying options to upload CSV files or use regular expressions for renaming entities.
-
Functionalities:
- Upload CSV File: Submit a CSV file containing entity IDs and new names for bulk renaming.
- Use Regex: Define search and replace patterns to rename entities matching a specific regex pattern.
- List Entities: Display a list of entities, filtered by a regex pattern, with options to rename.
- Rename Confirmation: Confirm and apply renaming changes to the listed entities.
To deploy and run the project locally, follow these steps:
-
Clone this repository:
git clone https://github.com/yourusername/home-assistant-entity-renamer.git cd home-assistant-entity-renamer
-
Install dependencies:
pip install -r requirements.txt
-
Set up the Django environment:
- Create a
.env
file to store environment variables such asSECRET_KEY
,DATABASE_URL
, etc. - Run database migrations:
python manage.py migrate
- Create a
-
Run the development server:
python manage.py runserver
-
Access the application:
- Open a web browser and navigate to
http://localhost:8000
.
- Open a web browser and navigate to
Below are the additional packages installed for this Django project:
- requests: For making HTTP requests to the Home Assistant API.
- websocket-client: For interacting with the Home Assistant WebSocket API.
- python-decouple: Simplifies handling of settings by separating configuration from code.
- django-crispy-forms: Assists in managing Django forms elegantly.
- crispy-bootstrap5: Extends crispy_forms to utilize Bootstrap 5 styles for forms.
Ensure the following environment variables are set in your .env
file:
SECRET_KEY
: A secret key for Django.DATABASE_URL
: Database connection URL.HOME_ASSISTANT_URL
: URL of your Home Assistant instance.ACCESS_TOKEN
: Access token for Home Assistant API.
The application uses the following Django model to store configurations:
- AppConfig: Stores user-specific configuration such as Home Assistant host, TLS settings, and access tokens.
All code and subsequent modifications in this project have been created by Pieter Coenen and are hereby released into the public domain. To the extent possible under law, I waive all copyright and related or neighboring rights to this work worldwide.
- Pieter Coenen - Project Lead & Developer
- @Saladpanda for starting the initial command line 'Home Assistant Entity Renamer project. This project essentially adds a User Interface to it.
Feel free to contribute, report issues, or suggest enhancements!