You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All documentation, api reference, Contribution guidelines and pretty much everything else you'd want to know is on our readthedocs site [here](https://homeassistantapi.rtfd.io)
33
35
34
-
## Installation
35
-
There are a variety of ways to install this wrapper.
36
-
37
-
### Using `pip` from [PYPI](https://pypi.org/project/homeassistant_api/)
38
-
```
39
-
$ pip install homeassistant_api
40
-
```
41
-
42
-
### Using Source from [GitHub](https://github.com/GrandMoff100/HomeassistantAPI)
Before using this library, you need to have Homeassistant OS running on a device.
52
-
Something like a Rasberry Pi or spare laptop.
53
-
54
-
### Enable `api` integration on Homeassistant
55
-
This library requires that you enable the [`api` integration](https://www.home-assistant.io/integrations/api) on your Homeassistant if you are familiar with setting up integrations.
56
-
57
-
### Access Token
58
-
Then once you have done that you need to head over to your profile and set up a "Long Lived Access Token" for you feed to the script. A good guide on how to do that is [here](https://www.home-assistant.io/docs/authentication/#your-account-profile)
59
-
60
-
### Exposing Homeassistant to the Web
61
-
You may want to setup a DNS server like DuckDNS
62
-
(a good youtube tutorial on how to do that [here](https://www.youtube.com/watch?v=AK5E2T5tWyM),
63
-
or port forwarding your homeassistant (if you are feeling adventurous)
64
-
Both options will allow you to access your Homeassistant remotely. All you will have to change is telling your script where to find your api (a.k.a. the base api endpoint)
65
-
66
-
## Usage
67
-
68
-
Once you have setup the `api` integration and created a Long Lived Access Token, its time to feed these into the script.
69
-
70
-
See [example.py](https://github.com/GrandMoff100/HomeAssistantAPI/blob/master/example.py)
71
-
72
-
```py
73
-
import os
74
-
from homeassistant_api import Client
75
-
76
-
# Tell the script where your homeassistant api server is, by typing it into the string in place of `<HOMEASSISTANT_API_ENDPOINT>`
77
-
url ='<HOMEASSISTANT_API_ENDPOINT>') # http://localhost:8123/api or https://myhomeassistant.duckdns.com:8123/api
78
-
79
-
# Copy and paste your long lived access token into the string in place of `<HOMEASSISTANT_TOKEN>`
0 commit comments