{"id":15086145,"url":"https://github.com/willmo103/home-assistant-litedb","last_synced_at":"2026-01-04T02:02:13.807Z","repository":{"id":251583313,"uuid":"837835151","full_name":"Willmo103/Home-Assistant-LiteDB","owner":"Willmo103","description":"A lightweight database solution to store and manage Home Assistant data with support for extended data collection and web-based visualization.","archived":false,"fork":false,"pushed_at":"2024-08-05T02:58:33.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T02:13:40.892Z","etag":null,"topics":["automation","datacollection","homeassistant","iot","python","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Willmo103.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-04T07:12:42.000Z","updated_at":"2024-11-26T23:50:05.000Z","dependencies_parsed_at":"2024-08-05T04:25:18.037Z","dependency_job_id":null,"html_url":"https://github.com/Willmo103/Home-Assistant-LiteDB","commit_stats":null,"previous_names":["willmo103/home_assistant_helper","willmo103/home-assistant-litedb"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Willmo103%2FHome-Assistant-LiteDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Willmo103%2FHome-Assistant-LiteDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Willmo103%2FHome-Assistant-LiteDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Willmo103%2FHome-Assistant-LiteDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Willmo103","download_url":"https://codeload.github.com/Willmo103/Home-Assistant-LiteDB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960666,"owners_count":20375105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","datacollection","homeassistant","iot","python","sqlite"],"created_at":"2024-09-25T07:31:59.363Z","updated_at":"2026-01-04T02:02:08.761Z","avatar_url":"https://github.com/Willmo103.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Home Assistant LiteDB\n\nHome Assistant LiteDB is a Python script designed to interact with Home Assistant, fetch entities, save them to a local SQLite database, and provide various command-line functionalities.\n\n## Features\n\n- Fetch entities from Home Assistant and save them to a SQLite database.\n- Purge the database and recreate it.\n- Display the last 50 rows of logs.\n- Configurable polling interval.\n- Logging to file and/or console.\n\n## Installation\n\n1. Clone the repository:\n\n    ```sh\n    git clone https://github.com/willmo103/home_assistant_litedb.git\n    cd home_assistant_litedb\n    ```\n\n2. Create a virtual environment and install dependencies:\n\n    ```sh\n    python -m venv venv\n    source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`\n    pip install -r requirements.txt\n    ```\n\n3. Run the setup script to create the configuration file:\n\n    ```sh\n    python setup.py\n    ```\n\n4. Edit `conf.yml` to add your Home Assistant URL and long-lived access token.\n\n## Usage\n\n### Command Line Arguments\n\n- `-d`, `--debug`: Run once and output logging to terminal.\n- `-p`, `--purge`: Purge entire database and recreate, do not poll after creation, exit and inform.\n- `-l`, `--logs`: Display the last 50 rows of the logs.\n- `--run-detached`: Run this script headless.\n- `--run-no-logging`: Run this script without logging (can only be used with `-d` or `--debug`).\n\n### Examples\n\n1. Fetch entities and save to database:\n\n    ```sh\n    python home_assistant_litedb/main.py\n    ```\n\n2. Run in debug mode:\n\n    ```sh\n    python home_assistant_litedb/main.py --debug\n    ```\n\n3. Purge the database:\n\n    ```sh\n    python home_assistant_litedb/main.py --purge\n    ```\n\n4. Display the last 50 rows of logs:\n\n    ```sh\n    python home_assistant_litedb/main.py --logs\n    ```\n\n## Configuration\n\nThe configuration is stored in `conf.yml`. Edit this file to set your Home Assistant URL, token, database path, and polling interval.\n\nExample `conf.yml`:\n\n```yaml\nHA_URL: 'http://192.168.xxx.xxx:8123'\nHA_TOKEN: '\u003cyour_long_lived_access_token\u003e'\nDB_PATH: 'C:\\\\Users\\\\YourUsername\\\\HomeAssistantLiteDB.db'\nPOLL_INTERVAL: 120\n```\n\n## License\n\nThis project is licensed under the MIT [License](LICENSE).\n\n## Roadmap\n\n- **Integration with Other Home Automation Platforms**\n  - Extend the functionality of Home-Assistant LiteDB to support data collection and management from other popular home automation platforms.\n  - Implement a unified interface to manage data from multiple platforms.\n\nRead the full [Roadmap](ROADMAP.md).\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request.\n\n## Contact\n\nFor any issues or questions, please open an issue on GitHub or contact me at \u003cwillmorris103@gmail.com\u003e.\n# Trigger new CI build\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillmo103%2Fhome-assistant-litedb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillmo103%2Fhome-assistant-litedb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillmo103%2Fhome-assistant-litedb/lists"}