Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

Supervisor development

These instructions are for development of the Supervisor, the Supervisor frontend panel and thehassio integration, by interacting with a development or remote supervisor, this assumes that you are using a development machine to do the development, these instructions will also use devcontainer and other tools that rely on Docker, so if you don't have that setup yet, do that before you continue.

Supervisor development

The instructions here is for development of the Supervisor itself.

  1. Fork the Supervisor repo (https://github.com/home-assistant/supervisor) and clone it to your development machine.
  2. Open the repo with Visual Studio Code devcontainer.
  3. Create a branch in your fork.
  4. Do your changes.
  5. Test your changes with the instructions below.
  6. Commit and push your changes, and create a PR against themain branch athttps://github.com/home-assistant/supervisor

Local testing

Start the task "Run Supervisor" in Visual Studio Code, this will start an instance of the Supervisor inside the devcontainer you can use to test your changes.When the initializing is complete you can access the Home Assistant frontend onhttp://localhost:9123

Testing on a remote system

For this you first need to create an account atDocker Hub.

  1. Access the remote system with SSH or with direct console access.
  2. Check the architecture on the machine withha info or justinfo if it's Home Assistant OS.
  3. On your development machine use ourbuilder to build and publish your Supervisor image.

Example:

note

All examples will have values you need to adjust.

  • Adjustaarch64 with the architecture you found in step 2.
  • Adjustawesome-user to match your Docker Hub username.
  • Adjustsecret-password to match your Docker Hub password or publish token.
docker run --rm \
--privileged \
-v /run/docker.sock:/run/docker.sock \
-v "$(pwd):/data" \
ghcr.io/home-assistant/amd64-builder:dev \
--generic latest \
--target /data \
--aarch64 \
--docker-hub awesome-user \
--docker-user awesome-user \
--docker-password secret-password \
--no-cache
  1. On your remote system change the channel todev withha supervisor --channel dev or justsupervisor --channel dev if it's Home Assistant OS.
  2. Pull down your Supervisor image withdocker pull awesome-user/aarch64-hassio-supervisor:latest
  3. Tag your Supervisor image ashomeassistant/aarch64-hassio-supervisor:latest
docker tag awesome-user/aarch64-hassio-supervisor:latest homeassistant/aarch64-hassio-supervisor:latest
  1. Restart thehassio-supervisor service withsystemctl restart hassos-supervisor
  2. Check for issues withjournalctl -fu hassos-supervisor

Integration development

The instructions here is for development of thehassio integration, we're going to assume that you have aHome Assistant Core development environment set up, and that you haveSupervisor API Access set up.

To configure Home Assistant Core to connect to a remote supervisor, set the following environment variables when starting Home Assistant:

  • SUPERVISOR: Set to the IP of the machine running Home Assistant and port 80 (the API proxy add-on)
  • SUPERVISOR_TOKEN: Set this to the token that you foundSupervisor API Access
SUPERVISOR=192.168.1.100:80 SUPERVISOR_TOKEN=abcdefghj1234 hass

Your local Home Assistant installation will now connect to a remote Home Assistant instance.

Frontend development

The instructions here is for development of the Supervisor panel, we're going to assume that you have aHome Assistant frontend development environment set up with the devcontainer, and that you haveSupervisor API Access set up.

  1. Run the "Develop Supervisor panel" task
  2. Run the task "Run HA Core for Supervisor in devcontainer"
  3. When asked for the IP, use the IP of the host that is runningSupervisor API Access
  4. When asked for the token, use the token you foundSupervisor API Access

Without frontend devcontainer

Update thehassio integration configuration in yourconfiguration.yaml file to point at the frontend repository:

# configuration.yaml
hassio:
# Example path. Change it to where you have checked out the frontend repository
development_repo: /home/paulus/dev/hass/frontend

To build a local version of the Supervisor panel, go to the frontend repository and run:

cd hassio
script/develop

Whilescript/develop is running, the Supervisor panel will be rebuilt whenever you make changes to the source files.

Supervisor API access

To develop for thehassio integration and the Supervisor panel, we're going to need API access to the supervisor. This API is protected by a token that we can extract using a special add-on. This can be done on a running system or with thedevcontainer.

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.Open your Home Assistant instance and show the dashboard of a Supervisor add-on.

  1. Add our developer Add-on repository:https://github.com/home-assistant/addons-development
  2. Install the Add-on "Remote API proxy"
  3. Click Start
  4. The token will be printed in the logs

The add-on needs to keep running to allow Home Assistant Core to connect.

The Remote API proxy token has slightly less privileges than Home Assistant Core has in production. To get the actual token with full privileges, you need to SSH into the host system and run:

docker inspect homeassistant | grep SUPERVISOR_TOKEN

Note that either token can change after a reboot or update of OS/container.


[8]ページ先頭

©2009-2025 Movatter.jp