{"id":29107517,"url":"https://github.com/envilleplease/openwebui_ha_current_date_time","last_synced_at":"2026-04-28T09:36:05.747Z","repository":{"id":297235938,"uuid":"995982526","full_name":"EnvillePlease/openwebui_ha_current_date_time","owner":"EnvillePlease","description":"This repository provides a Python tool to interface with your Home Assistant instance and fetches the current date and time. The tool is designed for easy integration with Open WebUI as a tool, or other Python-based projects that require access to date and time data managed by Home Assistant.","archived":false,"fork":false,"pushed_at":"2025-06-04T13:31:16.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-29T05:04:14.493Z","etag":null,"topics":["home-assistant","open-webui"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EnvillePlease.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-04T09:33:29.000Z","updated_at":"2025-06-04T13:31:18.000Z","dependencies_parsed_at":"2025-06-04T20:40:51.481Z","dependency_job_id":"23390f04-6cac-41ca-ba3f-316061209871","html_url":"https://github.com/EnvillePlease/openwebui_ha_current_date_time","commit_stats":null,"previous_names":["envilleplease/openwebui_ha_current_date_time"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EnvillePlease/openwebui_ha_current_date_time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnvillePlease%2Fopenwebui_ha_current_date_time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnvillePlease%2Fopenwebui_ha_current_date_time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnvillePlease%2Fopenwebui_ha_current_date_time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnvillePlease%2Fopenwebui_ha_current_date_time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EnvillePlease","download_url":"https://codeload.github.com/EnvillePlease/openwebui_ha_current_date_time/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnvillePlease%2Fopenwebui_ha_current_date_time/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262539073,"owners_count":23325832,"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":["home-assistant","open-webui"],"created_at":"2025-06-29T05:04:11.658Z","updated_at":"2026-04-28T09:36:05.676Z","avatar_url":"https://github.com/EnvillePlease.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenWebUI Home Assistant Current Date \u0026 Time Tool\n\nThis repository provides a Python tool to interface with your [Home Assistant](https://www.home-assistant.io/) instance and fetches the current date and time. The tool is designed for easy integration with Open WebUI as a tool, or other Python-based projects that require access to date and time data managed by Home Assistant.\n\n## What Does This Code Do?\n\n- **Fetches date \u0026 time Data**: Connects to your Home Assistant instance using the REST API to retrieve:\n  - Current date and time (single json entry returned in yyyy-mm-dd hh:mm:ss format)\n\n- **Returns Data as JSON**: All data is formatted as JSON for easy parsing and integration into other applications or user interfaces.\n\n- **Simple Configuration**: You can configure the tool by setting the required Home Assistant URL, API token, and sensor names.\n\n## How to Use\n\n1. **Clone or Fork the Repository**\n   - You are welcome to fork or clone this repository and use it as you wish!\n\n2. **Install Dependencies**\n   - This tool requires Python 3.7+ and the following packages:\n     - `requests`\n     - `pydantic`\n\n   ```bash\n   pip install requests pydantic\n   ```\n\n3. **Adapt for Your Home Assistant Instance**\n   - You **must** configure the following parameters in the code to match your Home Assistant setup:\n     - `HA_URL`: The base URL of your Home Assistant instance (e.g., `https://my-home-assistant.local:8123`).\n     - `HA_API_TOKEN`: A long-lived access token from your Home Assistant profile.\n     - `HA_DATE_TIME_SENSOR_NAME`: The sensor name for the current date and time.\n\n   These can be set by modifying the `Valves` class in `openwebui_ha_current_date_time_tool.py`, or by extending the class to read from environment variables or a configuration file.\n\n4. **Example Usage**\n\n   ```python\n   from openwebui_ha_current_date_time_tool import Tools\n\n   tools = Tools()\n   tools.valves.HA_URL = \"https://my-home-assistant.local:8123\"\n   tools.valves.HA_API_TOKEN = \"your_api_token_here\"\n   tools.valves.HA_DATE_TIME_SENSOR_NAM = \"sensor.current_date_time\"\n\n   date_time_json = tools.get_current_date_time()\n   print(date_time_json)\n   ```\n\n## Notes\n\n- **Customization Required**: You will need to adapt the sensor names to match those used in your own Home Assistant instance. These can be found in your Home Assistant dashboard under Developer Tools \u003e States.\n- **API Token Security**: Keep your Home Assistant API token private. Do not commit it to public repositories.\n\n## License \u0026 Usage\n\nFeel free to **fork**, modify, and use this code in your own projects. No restrictions are imposed—use it at your leisure!\n\n---\n\n**Happy automating!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvilleplease%2Fopenwebui_ha_current_date_time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenvilleplease%2Fopenwebui_ha_current_date_time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvilleplease%2Fopenwebui_ha_current_date_time/lists"}