{"id":14985279,"url":"https://github.com/grandmoff100/homeassistantapi","last_synced_at":"2025-12-25T03:14:41.389Z","repository":{"id":37253514,"uuid":"347772234","full_name":"GrandMoff100/HomeAssistantAPI","owner":"GrandMoff100","description":"Python Wrapper for Homeassistant's REST API","archived":false,"fork":false,"pushed_at":"2025-03-30T20:32:48.000Z","size":2361,"stargazers_count":75,"open_issues_count":0,"forks_count":21,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-04-13T05:06:32.772Z","etag":null,"topics":["aiohttp","api","async","hacktoberfest","home-assistant","home-automation","python","requests","rest","rest-api"],"latest_commit_sha":null,"homepage":"https://homeassistantapi.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrandMoff100.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-14T22:42:03.000Z","updated_at":"2025-03-27T20:42:52.000Z","dependencies_parsed_at":"2023-02-12T18:30:41.788Z","dependency_job_id":"b011a9e3-051e-49df-b42c-8bba64843d3b","html_url":"https://github.com/GrandMoff100/HomeAssistantAPI","commit_stats":{"total_commits":527,"total_committers":19,"mean_commits":"27.736842105263158","dds":"0.23149905123339654","last_synced_commit":"6b2ed9cd306c8a949111727d4956bc9f30b202a3"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandMoff100%2FHomeAssistantAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandMoff100%2FHomeAssistantAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandMoff100%2FHomeAssistantAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandMoff100%2FHomeAssistantAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrandMoff100","download_url":"https://codeload.github.com/GrandMoff100/HomeAssistantAPI/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665748,"owners_count":21142123,"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":["aiohttp","api","async","hacktoberfest","home-assistant","home-automation","python","requests","rest","rest-api"],"created_at":"2024-09-24T14:10:38.658Z","updated_at":"2025-12-25T03:14:41.306Z","avatar_url":"https://github.com/GrandMoff100.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HomeassistantAPI\n\n[![Code Coverage](https://img.shields.io/codecov/c/github/GrandMoff100/HomeAssistantAPI/dev?style=for-the-badge\u0026token=SJFC3HX5R1)](https://codecov.io/gh/GrandMoff100/HomeAssistantAPI)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/HomeAssistant-API?style=for-the-badge)](https://pypistats.org/packages/homeassistant-api)\n![GitHub commits since latest release (by date including pre-releases)](https://img.shields.io/github/commits-since/GrandMoff100/HomeassistantAPI/latest/dev?include_prereleases\u0026style=for-the-badge)\n[![Read the Docs (version)](https://img.shields.io/readthedocs/homeassistantapi?style=for-the-badge)](https://homeassistantapi.readthedocs.io/en/latest/?badge=latest)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/GrandMoff100/HomeassistantAPI?style=for-the-badge)](https://github.com/GrandMoff100/HomeassistantAPI/releases)\n\n\u003ca href=\"https://home-assistant.io\"\u003e\n    \u003cimg src=\"https://github.com/GrandMoff100/HomeAssistantAPI/blob/7edb4e6298d37bda19c08b807613c6d351788491/docs/images/homeassistant-logo.png?raw=true\" width=\"80%\"\u003e\n\u003c/a\u003e\n\n## Python wrapper for Homeassistant's [Websocket API](https://developers.home-assistant.io/docs/api/websocket/) and [REST API](https://developers.home-assistant.io/docs/api/rest/)\n\n\u003e Note: As of [this comment](https://github.com/home-assistant/architecture/discussions/1074#discussioncomment-9196867) the REST API is not getting any new features or endpoints.\n\u003e However, it is not going to be deprecated according to [this comment](https://github.com/home-assistant/developers.home-assistant/pull/2150#pullrequestreview-2017433583)\n\u003e But it is recommended to use the Websocket API for new integrations.\n\n### REST API Examples\n\n```py\nfrom homeassistant_api import Client\n\nwith Client(\n    '\u003cAPI Server URL\u003e', # i.e. 'http://homeassistant.local:8123/api/'\n    '\u003cYour Long Lived Access-Token\u003e'\n) as client:\n    light = client.trigger_service('light', 'turn_on', entity_id=\"light.living_room\")\n```\n\nAll the methods also support async/await!\nJust prefix the method with `async_` and pass the `use_async=True` argument to the `Client` constructor.\nThen you can use the methods as coroutines\n(i.e. `await light.async_turn_on(...)`).\n\n```py\nimport asyncio\nfrom homeassistant_api import Client\n\nasync def main():\n    with Client(\n        '\u003cREST API Server URL\u003e', # i.e. 'http://homeassistant.local:8123/api/'\n        '\u003cYour Long Lived Access-Token\u003e',\n        use_async=True\n    ) as client:\n    light = await client.async_trigger_service('light', 'turn_on', entity_id=\"light.living_room\")\n\nasyncio.run(main())\n```\n\n### Websocket API Example\n\n```py\nfrom homeassistant_api import WebsocketClient\n\nwith WebsocketClient(\n    '\u003cWS API Server URL\u003e', # i.e. 'ws://homeassistant.local:8123/api/websocket'\n    '\u003cYour Long Lived Access-Token\u003e'\n) as ws_client:\n    light = ws_client.trigger_service('light', 'turn_on', entity_id=\"light.living_room\")\n```\n\n\u003e Note: The Websocket API is not yet supported in async/await mode.\n\n## Documentation\n\nAll documentation, API reference, contribution guidelines and pretty much everything else\nyou'd want to know is on our readthedocs site [here](https://homeassistantapi.readthedocs.io)\n\nIf there is something missing, open an issue and let us know! Thanks!\n\nGo make some cool stuff! Maybe come back and tell us about it in a\n[discussion](https://github.com/GrandMoff100/HomeAssistantAPI/discussions)?\nWe'd love to hear about how you use our library!!\n\n## License\n\nThis project is under the GNU GPLv3 license, as defined by the Free Software Foundation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrandmoff100%2Fhomeassistantapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrandmoff100%2Fhomeassistantapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrandmoff100%2Fhomeassistantapi/lists"}