Creates a FastAPI bridge to Home Assistant for use with the simplified Custom API interface in Presence Light
- Download the Docker file from here
- Run the Docker file on a server of your choice (including your local machine)
- Get a Long-lived Access Token from your Home Assistant installation
- Set the following environment variables in Docker:
- HA_IP: The IP Address or FQDN of your Home Assistant installation that the Docker container will be able to access
- HA_PORT: The port that your Home Assistant installation runs on (Normally, this is
8123
) - HA_ENTITY: The entity name of the light you want to use in the
<domain>.<name>
format. (I uselight.office_status_light
in mine.)- Note: This light must support RGB, or this application will fail
- HA_TOKEN: The long-lived access token you generated earlier
- HA_BRIGHTNESS: An integer between 0 and 100
- Run the Docker container with the command
docker run -d --restart=unless-stopped -e "HA_IP=<your-ip>" -e "HA_PORT=<your-port>" -e "HA_ENTITY=<domain>.<name>" -e "HA_TOKEN=<your-token>" -e "HA_BRIGHTNESS=<your-brightness>" --name=presence-light-ha-api loganjlong/presence-light-ha-api
- Set the Custom API values in Presence Light. You should replace the IP and port seen below with the IP and port of this Docker container (not your Home Assistant installation). All calls in this application use POST.
/available
: Sets the light green/away
: Sets the light yellow/busy
: Sets the light red/offline
: Turns the light off