端点

import ApiEndpoint from '@site/static/js/api_endpoint.jsx'

带有 :lock: 标记的 API 端点需要使用 Bearer token 形式的授权请求头。

应用(以前称为附加组件)和 Home Assistant 可以通过以下方式获取该 token: SUPERVISOR_TOKEN 环境变量。

要查看每个端点的更多详细信息,请点击将其展开。

应用

返回已安装应用的概览信息。

负载:

类型说明
addonslistAddon 模型列表

示例响应:

{
  "addons": [
    {
      "name": "Awesome app",
      "slug": "awesome_addon",
      "description": "My awesome app",
      "advanced": false,
      "stage": "stable",
      "repository": "core",
      "version": null,
      "version_latest": "1.0.1",
      "update_available": false,
      "installed": false,
      "detached": true,
      "available": true,
      "build": false,
      "url": null,
      "icon": false,
      "logo": false,
      "system_managed": false
    }
  ]
}
重新加载已存储的应用信息。 获取应用的更新日志。 获取应用文档。

通过 Systemd journal 后端获取应用日志。

该端点接受与 /host/logs 相同的请求头,并提供相同的功能。

/addons/<addon>/logs 相同,但会持续返回新的日志条目。

返回该应用容器最近一次启动的全部日志。

会忽略 Range 请求头,但可以使用 lines 查询参数。

获取与特定启动记录相关的应用日志。

bootid 参数的解释方式与 /host/logs/boots/<bootid> 中一致, 该端点其余功能也与 /host/logs 相同。

/addons/<addon>/logs/boots/<bootid> 相同,但会持续返回新的日志条目。

获取应用图标 获取应用详情

返回数据:

keytypedescription
advancedbooleantrue if advanced mode is enabled
apparmorstringdisabled, default or the name of the profile
archlistA list of supported architectures for the app
audiobooleantrue if audio is enabled
audio_inputfloat or nullThe device index
audio_outputfloat or nullThe device index
auth_apibooleantrue if auth api access is granted is enabled
auto_uartbooleantrue if auto_uart access is granted is enabled
auto_updatebooleantrue if auto update is enabled
availablebooleantrue if the app is available
bootstring"auto" or "manual"
boot_configstringDefault boot mode of addon or "manual_only" if boot mode cannot be auto
buildbooleantrue if local app
changelogbooleantrue if changelog is available
descriptionstringThe app description
detachedbooleantrue if the app is running detached
deviceslistA list of attached devices
devicetreebooleantrue if devicetree access is granted is enabled
discoverylistA list of discovery services
dnslistA list of DNS servers used by the app
docker_apibooleantrue if docker_api access is granted is enabled
documentationbooleantrue if documentation is available
full_accessbooleantrue if full access access is granted is enabled
gpiobooleantrue if gpio access is granted is enabled
hassio_apibooleantrue if hassio api access is granted is enabled
hassio_rolestringThe hassio role (default, homeassistant, manager, admin)
homeassistantstring or nullThe minimum Home Assistant Core version
homeassistant_apibooleantrue if homeassistant api access is granted is enabled
host_dbusbooleantrue if host dbus access is granted is enabled
host_ipcbooleantrue if host ipc access is granted is enabled
host_networkbooleantrue if host network access is granted is enabled
host_pidbooleantrue if host pid access is granted is enabled
host_utsbooleantrue if host UTS namespace access is enabled.
hostnamestringThe host name of the app
iconbooleantrue if icon is available
ingressbooleantrue if ingress is enabled
ingress_entrystring or nullThe ingress entrypoint
ingress_panelboolean or nulltrue if ingress_panel is enabled
ingress_portint or nullThe ingress port
ingress_urlstring or nullThe ingress URL
ip_addressstringThe IP address of the app
kernel_modulesbooleantrue if kernel module access is granted is enabled
logobooleantrue if logo is available
long_descriptionstringThe long app description
machinelistA list of supported machine types for the app
namestringThe name of the app
networkdictionary or nullThe network configuration for the app
network_descriptiondictionary or nullThe description for the network configuration
optionsdictionaryThe app configuration
privilegedlistA list of hardwars/system attributes the app has access to
protectedbooleantrue if protection mode is enabled
ratingintThe addon rating
repositorystringThe URL to the app repository
schemadictionary or nullThe schema for the app configuration
services_rolelistA list of services and the apps role for that service
slugstringThe app slug
stagestringThe app stage (stable, experimental, deprecated)
startupstringThe stage when the app is started (initialize, system, services, application, once)
statestring or nullThe state of the app (started, stopped)
stdinbooleantrue if the app accepts stdin commands
system_managedbooleanIndicates whether the app is managed by Home Assistant
system_managed_config_entrystringProvides the configuration entry ID if the app is managed by Home Assistant
translationsdictionaryA dictionary containing content of translation files for the app
udevbooleantrue if udev access is granted is enabled
update_availablebooleantrue if an update is available
urlstring or nullURL to more information about the app
usblistA list of attached USB devices
versionstringThe installed version of the app
version_lateststringThe latest version of the app
videobooleantrue if video is enabled
watchdogbooleantrue if watchdog is enabled
webuistring or nullThe URL to the web UI for the app
signedbooleanTrue if the image is signed and trust

示例响应:

{
  "advanced": false,
  "apparmor": "default",
  "arch": ["armhf", "aarch64", "i386", "amd64"],
  "audio_input": null,
  "audio_output": null,
  "audio": false,
  "auth_api": false,
  "auto_uart": false,
  "auto_update": false,
  "available": false,
  "boot": "auto",
  "boot_config": "auto",
  "build": false,
  "changelog": false,
  "description": "description",
  "detached": false,
  "devices": ["/dev/xy"],
  "devicetree": false,
  "discovery": ["service"],
  "dns": [],
  "docker_api": false,
  "documentation": false,
  "full_access": false,
  "gpio": false,
  "hassio_api": false,
  "hassio_role": "default",
  "homeassistant_api": false,
  "homeassistant": null,
  "host_dbus": false,
  "host_ipc": false,
  "host_network": false,
  "host_pid": false,
  "host_uts": false,
  "hostname": "awesome-addon",
  "icon": false,
  "ingress_entry": null,
  "ingress_panel": true,
  "ingress_port": 1337,
  "ingress_url": null,
  "ingress": false,
  "ip_address": "172.0.0.21",
  "kernel_modules": false,
  "logo": false,
  "long_description": "Long description",
  "machine": ["raspberrypi2", "tinker"],
  "name": "Awesome app",
  "network_description": "{}|null",
  "network": {},
  "options": {},
  "privileged": ["NET_ADMIN", "SYS_ADMIN"],
  "protected": false,
  "rating": "1-6",
  "repository": "12345678",
  "schema": {},
  "services_role": ["service:access"],
  "slug": "awesome_addon",
  "stage": "stable",
  "startup": "application",
  "state": "started",
  "stdin": false,
  "system_managed": true,
  "system_managed_config_entry": "abc123",
  "translations": {
    "en": {
      "configuration": {
        "lorem": "ipsum"
      }
    }
  },
  "udev": false,
  "update_available": false,
  "url": null,
  "usb": ["/dev/usb1"],
  "version_latest": "1.0.2",
  "version": "1.0.0",
  "video": false,
  "watchdog": true,
  "webui": "http://[HOST]:1337/xy/zx",
  "signed": false
}
安装应用

Deprecated! Use /store/addons/<addon>/install instead.

获取应用 logo 设置应用选项。
Tip

若要重置自定义的 network/audio/options,请将其设为 null

负载:

类型说明
bootstring(auto, manual)
auto_updatebooleantrue 表示应用应自动更新
networkdictionary网络配置映射。
optionsdictionary应用配置
audio_outputfloat or null音频输出设备索引
audio_inputfloat or null音频输入设备索引
ingress_panelbooleantrue 表示已启用 ingress_panel
watchdogbooleantrue 表示已启用 watchdog

你至少需要在负载中提供一个键。

示例负载:

{
  "boot": "manual",
  "auto_update": false,
  "network": {
    "CONTAINER": "1337"
  },
  "options": {
    "awesome": true
  },
  "watchdog": true
}
修改系统托管应用的专用选项。

该端点只能由 Home Assistant 调用,其他客户端不能调用。

负载:

类型说明
system_managedbooleantrue 表示由 Home Assistant 管理
system_managed_config_entryboolean管理该应用的配置条目 ID

你至少需要在负载中提供一个键。

示例负载:

{
  "system_managed": true,
  "system_managed_config_entry": "abc123"
}
针对当前已存储的应用配置或传入负载执行配置校验。

负载:

可选:原始应用选项。

返回数据:

类型说明
messagestring错误信息
validboolean配置是否有效
pwnedbooleanNone
用于获取其自身渲染后配置的数据端点。 重新构建应用,仅支持本地构建型应用。

负载:

keytypeoptionaldescription
forcebooleanTrueForce rebuild of the app even if pre-built images are provided
重启应用 Set the protection mode on an app.

This function is not callable by itself and you can not use self as the slug here.

负载:

keytypedescription
protectedbooleantrue if protection mode is on
启动应用

返回该应用对应的 Stats 模型

示例响应:

{
  "cpu_percent": 14.0,
  "memory_usage": 288888,
  "memory_limit": 322222,
  "memory_percent": 32.4,
  "network_tx": 110,
  "network_rx": 902,
  "blk_read": 12,
  "blk_write": 27
}
向应用的 stdin 写入数据。

你想传递给应用的负载应作为请求体发送到该端点。

停止应用 卸载应用

负载:

类型可选说明
remove_configbooleanTrue删除应用的配置文件夹(如果有)
更新应用

已弃用! 请改用 /store/addons/<addon>/update

音频

Set a profile as the default input profile

负载:

keytypeoptionaldescription
namestringFalseThe name of the profile
Set a profile as the default output profile

负载:

keytypeoptionaldescription
namestringFalseThe name of the profile
Return information about the audio plugin.

返回数据:

keytypedescription
hoststringThe IP address of the plugin
versionstringThe installed observer version
version_lateststringThe latest published version
update_availablebooleantrue if an update is available
audiodictionaryAn Audio model

示例响应:

{
  "host": "172.0.0.19",
  "version": "1",
  "latest_version": "2",
  "update_available": true,
  "audio": {
    "card": [
      {
        "name": "Awesome card",
        "index": 1,
        "driver": "Awesome driver",
        "profiles": [
          {
            "name": "Awesome profile",
            "description": "My awesome profile",
            "active": false
          }
        ]
      }
    ],
    "input": [
      {
        "name": "Awesome device",
        "index": 0,
        "description": "My awesome device",
        "volume": 0.3,
        "mute": false,
        "default": false,
        "card": null,
        "applications": [
          {
            "name": "Awesome application",
            "index": 0,
            "stream_index": 0,
            "stream_type": "INPUT",
            "volume": 0.3,
            "mute": false,
            "addon": "awesome_addon"
          }
        ]
      }
    ],
    "output": [
      {
        "name": "Awesome device",
        "index": 0,
        "description": "My awesome device",
        "volume": 0.3,
        "mute": false,
        "default": false,
        "card": 1,
        "applications": [
          {
            "name": "Awesome application",
            "index": 0,
            "stream_index": 0,
            "stream_type": "INPUT",
            "volume": 0.3,
            "mute": false,
            "addon": "awesome_addon"
          }
        ]
      }
    ],
    "application": [
      {
        "name": "Awesome application",
        "index": 0,
        "stream_index": 0,
        "stream_type": "OUTPUT",
        "volume": 0.3,
        "mute": false,
        "addon": "awesome_addon"
      }
    ]
  }
}

Get logs for the audio plugin container via the Systemd journal backend.

The endpoint accepts the same headers and provides the same functionality as /host/logs.

Identical to /audio/logs except it continuously returns new log entries.

Return all logs of the latest startup of the audio plugin container.

The Range header is ignored but the lines query parameter can be used.

Get logs for the audio plugin container related to a specific boot.

The bootid parameter is interpreted in the same way as in /host/logs/boots/<bootid> and the endpoint otherwise provides the same functionality as /host/logs.

Identical to /audio/logs/boots/<bootid> except it continuously returns new log entries.

Mute input devices

负载:

keytypeoptionaldescription
indexstringFalseThe index of the device
activebooleanFalsetrue if muted
Mute input for a specific application

负载:

keytypeoptionaldescription
indexstringFalseThe index of the device
activebooleanFalsetrue if muted
Mute output devices

负载:

keytypeoptionaldescription
indexstringFalseThe index of the device
activebooleanFalsetrue if muted
Mute output for a specific application

负载:

keytypeoptionaldescription
indexstringFalseThe index of the device
activebooleanFalsetrue if muted
Create an audio profile

负载:

keytypeoptionaldescription
cardstringFalseThe name of the audio device
namestringFalseThe name of the profile
Reload audio information Restart the audio plugin

Returns a Stats model for the audio plugin.

示例响应:

{
  "cpu_percent": 14.0,
  "memory_usage": 288888,
  "memory_limit": 322222,
  "memory_percent": 32.4,
  "network_tx": 110,
  "network_rx": 902,
  "blk_read": 12,
  "blk_write": 27
}
Update the audio plugin

负载:

keytypedescription
versionstringThe version you want to install, default is the latest version
Set the input volume

负载:

keytypeoptionaldescription
indexstringFalseThe index of the device
volumefloatFalseThe volume (between 0.0and 1.0)
Set the input volume for a specific application

负载:

keytypeoptionaldescription
indexstringFalseThe index of the device
volumefloatFalseThe volume (between 0.0and 1.0)
Set the output volume

负载:

keytypeoptionaldescription
indexstringFalseThe index of the device
volumefloatFalseThe volume (between 0.0and 1.0)
Set the output volume for a specific application

负载:

keytypeoptionaldescription
indexstringFalseThe index of the device
volumefloatFalseThe volume (between 0.0and 1.0)

认证

You can do authentication against Home Assistant Core using Basic Authentication. Use the `X-Supervisor-Token` header to provide the Supervisor authentication token. See the corresponding POST method to provide JSON or urlencoded credentials. You can do authentication against Home Assistant Core. You can POST the data as JSON, as urlencoded (with `application/x-www-form-urlencoded` header) or by using use basic authentication. For using Basic authentication, you can use the `X-Supervisor-Token` for Supervisor authentication token.

负载:

keytypedescription
usernamestringThe username for the user
passwordstringThe password for the user
Set a new password for a Home Assistant Core user.

负载:

keytypedescription
usernamestringThe username for the user
passwordstringThe new password for the user

Reset internal authentication cache, this is useful if you have changed the password for a user and need to clear the internal cache.

List all users in Home Assistant to help with credentials recovery. Requires an admin level authentication token.

负载:

keytypedescription
userslistList of the Home Assistant users.

备份

Return a list of Backups

示例响应:

{
  "backups": [
    {
      "slug": "skuwe823",
      "date": "2020-09-30T20:25:34.273Z",
      "name": "Awesome backup",
      "type": "partial",
      "size": 44,
      "protected": true,
      "location": "MountedBackups",
      "compressed": true,
      "content": {
        "homeassistant": true,
        "addons": ["awesome_addon"],
        "folders": ["ssl", "media"]
      }
    }
  ]
}

Return information about backup manager.

返回数据:

keytypedescription
backupslistA list of Backups
days_until_staleintNumber of days until a backup is considered stale

示例响应:

{
  "backups": [
    {
      "slug": "skuwe823",
      "date": "2020-09-30T20:25:34.273Z",
      "name": "Awesome backup",
      "type": "partial",
      "size": 44,
      "protected": true,
      "compressed": true,
      "location": null,
      "content": {
        "homeassistant": true,
        "addons": ["awesome_addon"],
        "folders": ["ssl", "media"]
      }
    }
  ],
  "days_until_stale": 30
}

Create a full backup.

负载:

keytypeoptionaldescription
namestringTrueThe name you want to give the backup
passwordstringTrueThe password you want to give the backup
compressedbooleanTruefalse to create uncompressed backups
locationstring or nullTrueName of a backup mount or null for /backup
homeassistant_exclude_databasebooleanTrueExclude the Home Assistant database file from backup
backgroundbooleanTrueReturn job_id immediately, do not wait for backup to complete. Clients must check job for status and slug.

示例响应:

{
  "slug": "skuwe823"
}

Upload a backup.

示例响应:

{
  "slug": "skuwe823",
  "job_id": "abc123"
}
Note

Error responses from this API may also include a job_id if the message alone cannot accurately describe what happened. Callers should direct users to review the job or supervisor logs to get an understanding of what occurred.

Create a partial backup.

负载:

keytypeoptionaldescription
namestringTrueThe name you want to give the backup
passwordstringTrueThe password you want to give the backup
homeassistantbooleanTrueAdd home assistant core settings to the backup
addonslistTrueA list of strings representing app slugs
folderslistTrueA list of strings representing directories
compressedbooleanTruefalse to create uncompressed backups
locationstring or nullTrueName of a backup mount or null for /backup
homeassistant_exclude_databasebooleanTrueExclude the Home Assistant database file from backup
backgroundbooleanTrueReturn job_id immediately, do not wait for backup to complete. Clients must check job for status and slug.

你至少需要在负载中提供一个键。

示例响应:

{
  "slug": "skuwe823",
  "job_id": "abc123"
}
Note

Error responses from this API may also include a job_id if the message alone cannot accurately describe what happened. Callers should direct users to review the job or supervisor logs to get an understanding of what occurred.

Update options for backup manager, you need to supply at least one of the payload keys to the API call.

负载:

keytypedescription
days_until_staleintSet number of days until a backup is considered stale

你至少需要在负载中提供一个键。

Reload backup from storage.

Put Supervisor in a freeze state and prepare Home Assistant and addons for an external backup.

Note

This does not take a backup. It prepares Home Assistant and addons for one but the expectation is that the user is using an external tool to make the backup. Such as the snapshot feature in KVM or Proxmox. The caller should call /backups/thaw when done.

负载:

keytypeoptionaldescription
timeoutintTrueSeconds before freeze times out and thaw begins automatically (default: 600).

End a freeze initiated by /backups/freeze and resume normal behavior in Home Assistant and addons.

Download the backup file with the given slug.

Returns a Backup details model for the app.

Removes the backup file with the given slug.

Does a full restore of the backup with the given slug.

负载:

keytypeoptionaldescription
passwordstringTrueThe password for the backup if any
backgroundbooleanTrueReturn job_id immediately, do not wait for restore to complete. Clients must check job for status.

示例响应:

{
  "job_id": "abc123"
}
Note

Error responses from this API may also include a job_id if the message alone cannot accurately describe what happened. Callers should direct users to review the job or supervisor logs to get an understanding of what occurred.

Does a partial restore of the backup with the given slug.

负载:

keytypeoptionaldescription
homeassistantbooleanTruetrue if Home Assistant should be restored
addonslistTrueA list of app slugs that should be restored
folderslistTrueA list of directories that should be restored
passwordstringTrueThe password for the backup if any
backgroundbooleanTrueReturn job_id immediately, do not wait for restore to complete. Clients must check job for status.

你至少需要在负载中提供一个键。

示例响应:

{
  "job_id": "abc123"
}
Note

Error responses from this API may also include a job_id if the message alone cannot accurately describe what happened. Callers should direct users to review the job or supervisor logs to get an understanding of what occurred.

CLI

Returns information about the CLI plugin

返回数据:

keytypedescription
versionstringThe installed cli version
version_lateststringThe latest published version
update_availablebooleantrue if an update is available

示例响应:

{
  "version": "1",
  "version_latest": "2",
  "update_available": true
}

Returns a Stats model for the CLI plugin.

示例响应:

{
  "cpu_percent": 14.0,
  "memory_usage": 288888,
  "memory_limit": 322222,
  "memory_percent": 32.4,
  "network_tx": 110,
  "network_rx": 902,
  "blk_read": 12,
  "blk_write": 27
}
Update the CLI plugin

负载:

keytypedescription
versionstringThe version you want to install, default is the latest version

Core

Proxy GET API calls to the Home Assistant API Proxy POST API calls to the Home Assistant API Run a configuration check Returns information about the Home Assistant core

返回数据:

keytypedescription
versionstringThe installed core version
version_lateststringThe latest published version in the active channel
update_availablebooleantrue if an update is available
archstringThe architecture of the host (armhf, aarch64, i386, amd64)
machinestringThe machine type that is running the host
ip_addressstringThe internal docker IP address to the supervisor
imagestringThe container image that is running the core
bootbooleantrue if it should start on boot
portintThe port Home Assistant is running on
sslbooleantrue if Home Assistant is using SSL
watchdogbooleantrue if watchdog is enabled
wait_bootintMax time to wait during boot
audio_inputstring or nullThe description of the audio input device
audio_outputstring or nullThe description of the audio output device
backups_exclude_databasebooleanBackups exclude Home Assistant database file by default
duplicate_log_filebooleanHome Assistant duplicates logs to a file

示例响应:

{
  "version": "0.117.0",
  "version_latest": "0.117.0",
  "update_available": true,
  "arch": "arch",
  "machine": "amd64",
  "ip_address": "172.0.0.15",
  "image": "homeassistant/home-assistant",
  "boot": true,
  "port": 8123,
  "ssl": false,
  "watchdog": true,
  "wait_boot": 800,
  "audio_input": "AMCP32",
  "audio_output": "AMCP32"
}

Get logs for the Home Assistant Core container via the Systemd journal backend.

The endpoint accepts the same headers and provides the same functionality as /host/logs.

Identical to /core/logs except it continuously returns new log entries.

Return all logs of the latest startup of the Home Assistant Core container.

The Range header is ignored but the lines query parameter can be used.

Get logs for the Home Assistant Core container related to a specific boot.

The bootid parameter is interpreted in the same way as in /host/logs/boots/<bootid> and the endpoint otherwise provides the same functionality as /host/logs.

Identical to /core/logs/boots/<bootid> except it continuously returns new log entries.

Update options for Home Assistant, you need to supply at least one of the payload keys to the API call. You need to call `/core/restart` after updating the options.
Tip

Passing image, refresh_token, audio_input or audio_output with null resets the option.

负载:

keytypedescription
bootbooleanStart Core on boot
imagestring or nullName of custom image
portintThe port that Home Assistant run on
sslbooleantrue to enable SSL
watchdogbooleantrue to enable the watchdog
wait_bootintTime to wait for Core to startup
refresh_tokenstring or nullToken to authenticate with Core
audio_inputstring or nullProfile name for audio input
audio_outputstring or nullProfile name for audio output
backups_exclude_databasebooleantrue to exclude Home Assistant database file from backups
duplicate_log_filebooleantrue to duplicate Home Assistant logs to a file

你至少需要在负载中提供一个键。

Rebuild the Home Assistant core container

负载:

keytypeoptionaldescription
safe_modebooleanTrueRebuild Core into safe mode
forcebooleanTrueForce rebuild during a Home Assistant offline db migration
Restart the Home Assistant core container

负载:

keytypeoptionaldescription
safe_modebooleanTrueRestart Core into safe mode
forcebooleanTrueForce restart during a Home Assistant offline db migration
Start the Home Assistant core container

Returns a Stats model for the Home Assistant core.

示例响应:

{
  "cpu_percent": 14.0,
  "memory_usage": 288888,
  "memory_limit": 322222,
  "memory_percent": 32.4,
  "network_tx": 110,
  "network_rx": 902,
  "blk_read": 12,
  "blk_write": 27
}
Stop the Home Assistant core container

负载:

keytypeoptionaldescription
forcebooleanTrueForce stop during a Home Assistant offline db migration
Update Home Assistant core

负载:

keytypedescription
versionstringThe version you want to install, default is the latest version
backupbooleanCreate a partial backup of core and core configuration before updating, default is false
Proxy to Home Assistant Core websocket.

发现

Return information about enabled discoveries.

返回数据:

keytypedescription
discoverylistA list of Discovery models
servicesdictionaryA dictionary of services that contains a list of apps that have that service.

示例响应:

{
  "discovery": [
    {
      "addon": "awesome_addon",
      "service": "awesome.service",
      "uuid": "fh874r-fj9o37yr3-fehsf7o3-fd798",
      "config": {}
    }
  ],
  "services": {
    "awesome": ["awesome_addon"]
  }
}
Create a discovery service

负载:

keytypeoptionaldescription
servicestringFalseThe name of the service
configdictionaryFalseThe configuration of the service

示例响应:

{
  "uuid": "uuid"
}

Get a discovery model for a UUID.

Delete a specific service.

DNS

Return information about the DNS plugin.

返回数据:

keytypedescription
fallbackboolTry fallback DNS on failure
hoststringThe IP address of the plugin
llmnrboolCan resolve LLMNR hostnames
localslistA list of DNS servers
mdnsboolCan resolve MulticastDNS hostnames
serverslistA list of DNS servers
update_availablebooleantrue if an update is available
versionstringThe installed observer version
version_lateststringThe latest published version

示例响应:

{
  "host": "127.0.0.18",
  "version": "1",
  "version_latest": "2",
  "update_available": true,
  "servers": ["dns://8.8.8.8"],
  "locals": ["dns://127.0.0.18"],
  "mdns": true,
  "llmnr": false,
  "fallback": true
}

Get logs for the DNS plugin container via the Systemd journal backend.

The endpoint accepts the same headers and provides the same functionality as /host/logs.

Identical to /dns/logs except it continuously returns new log entries.

Return all logs of the latest startup of the DNS plugin container.

The Range header is ignored but the lines query parameter can be used.

Get logs for the DNS plugin container related to a specific boot.

The bootid parameter is interpreted in the same way as in /host/logs/boots/<bootid> and the endpoint otherwise provides the same functionality as /host/logs.

Identical to /dns/logs/boots/<bootid> except it continuously returns new log entries.

Set DNS options

负载:

keytypeoptionaldescription
fallbackboolTrueEnable/Disable fallback DNS
serverslistTrueA list of DNS servers

你至少需要在负载中提供一个键。

Reset the DNS configuration. Restart the DNS plugin

Returns a Stats model for the dns plugin.

示例响应:

{
  "cpu_percent": 14.0,
  "memory_usage": 288888,
  "memory_limit": 322222,
  "memory_percent": 32.4,
  "network_tx": 110,
  "network_rx": 902,
  "blk_read": 12,
  "blk_write": 27
}
Update the DNS plugin

负载:

keytypedescription
versionstringThe version you want to install, default is the latest version

Docker

Returns information about the docker instance.

返回数据:

keytypedescription
versionstringThe version of the docker engine
enable_ipv6boolEnable/Disable IPv6 for containers
storagestringThe storage type
loggingstringThe logging type
registriesdictionaryA dictionary of dictionaries containing username and password keys for registries.

示例响应:

{
  "version": "1.0.1",
  "enable_ipv6": true,
  "storage": "overlay2",
  "logging": "journald",
  "registries": {}
}
Set docker options

负载:

keytypeoptionaldescription
enable_ipv6boolTrueEnable/Disable IPv6 for containers

你至少需要在负载中提供一个键。

Get all configured container registries, this returns a dict with the registry hostname as the key, and a dictionary containing the username configured for that registry.

示例响应:

{
  "registry.example.com": {
    "username": "AwesomeUser"
  }
}
Add a new container registry.

负载:

keytypedescription
hostnamedictionaryA dictionary containing username and password keys for the registry.

示例负载:

{
  "registry.example.com": {
    "username": "AwesomeUser",
    "password": "MySuperStrongPassword!"
  }
}
Note

To login to the default container registry (Docker Hub), use hub.docker.com as the registry.

Delete a registry from the configured container registries. Schedule a Docker storage driver migration. The migration will be applied on the next system reboot.

This endpoint allows migrating to either:

  • overlayfs: The Containerd overlayfs driver
  • overlay2: The Docker graph overlay2 driver
Note

This endpoint requires Home Assistant OS 17.0 or newer. A 404 error will be returned on older versions or non-HAOS installations.

负载:

keytypeoptionaldescription
storage_driverstringFalseThe target storage driver (overlayfs or overlay2)

示例负载:

{
  "storage_driver": "overlayfs"
}

After calling this endpoint, a reboot is required to apply the migration. The response will create a reboot_required issue in the resolution center.

硬件

Get hardware information.

示例响应:

{
    "devices": [
      {
        "name": "ttyACM0",
        "sysfs": "/sys/devices/usb/00:01",
        "dev_path": "/dev/ttyACM0",
        "by_id": "/dev/serial/by-id/usb-Silicon_Labs-RFUSB_9017F723B061A7C01410CFCF-if00-port1",
        "subsystem": "tty",
        "parent": null,
        "attributes": {
          "MINOR": "5"
        },
        "children": [
          "/sys/devices/soc/platform/00ef"
        ]
      }
    ],
    "drives": [
      {
        "vendor": "Generic",
        "model": "Flash Disk",
        "revision": "8.07",
        "serial": "AABBCCDD",
        "id": "Generic-Flash-Disk-AABBCCDD",
        "size": 8054112256,
        "time_detected": "2023-02-15T21:44:22.504878+00:00",
        "connection_bus": "usb",
        "seat": "seat0",
        "removable": true,
        "ejectable": true,
        "filesystems": [
          {
            "device": "/dev/sda1",
            "id": "by-uuid-1122-1ABA",
            "size": 67108864,
            "name": "",
            "system": false,
            "mount_points": []
          }
        ]
      }
    ]
}

返回数据:

keydescription
devicesA list of Device models
drivesA list of Drive models
Get audio devices

示例响应:

{
  "audio": {
    "input": {
      "0,0": "Mic"
    },
    "output": {
      "1,0": "Jack",
      "1,1": "HDMI"
    }
  }
}

主机

Return information about the host.

Returned data

keytypedescription
agent_versionstring or nullAgent version running on the Host
apparmor_versionstring or nullThe AppArmor version from host
boot_timestampintThe timestamp for the last boot in microseconds
broadcast_llmnrbool or nullHost is broadcasting its LLMNR hostname
broadcast_mdnsbool or nullHost is broadcasting its MulticastDNS hostname
chassisstring or nullThe chassis type
virtualizationstring or nullVirtualization hypervisor in use (if any)
cpestring or nullThe local CPE
deploymentstring or nullThe deployment stage of the OS if any
disk_totalfloatTotal space of the disk in MB
disk_usedfloatUsed space of the disk in MB
disk_freefloatFree space of the disk in MB
featureslistA list of features available for the host
hostnamestring or nullThe hostname of the host
kernelstring or nullThe kernel version on the host
llmnr_hostnamestring or nullThe hostname currently exposed on the network via LLMNR for host
operating_systemstringThe operating system on the host
startup_timefloatThe time in seconds it took for last boot
disk_life_timefloat or nullPercentage of estimated disk lifetime used (0–100). Not all disks provide this information, returns null if unavailable.
timezonestringThe current timezone of the host.
dt_utcstringCurrent UTC date/time of the host in ISO 8601 format.
dt_synchronizedbooltrue if the host is synchronized with an NTP service.
use_ntpbooltrue if the host is using an NTP service for time synchronization.

示例响应:

{
  "agent_version": "1.2.0",
  "apparmor_version": "2.13.2",
  "chassis": "specific",
  "cpe": "xy",
  "deployment": "stable",
  "disk_total": 32.0,
  "disk_used": 30.0,
  "disk_free": 2.0,
  "features": ["shutdown", "reboot", "hostname", "services", "haos"],
  "hostname": "Awesome host",
  "llmnr_hostname": "Awesome host",
  "kernel": "4.15.7",
  "operating_system": "Home Assistant OS",
  "boot_timestamp": 1234567788,
  "startup_time": 12.345,
  "broadcast_llmnr": true,
  "broadcast_mdns": false,
  "virtualization": "",
  "disk_life_time": 10.0,
  "timezone": "Europe/Brussels",
  "dt_utc": "2025-09-08T12:00:00.000000+00:00",
  "dt_synchronized": true,
  "use_ntp": true
}

Get systemd Journal logs from the host. Returns log entries in plain text, one log record per line.

HTTP Request Headers

Headeroptionaldescription
AccepttrueType of data (text/plain or text/x-log)
RangetrueRange of log entries. The format is entries=cursor[[:num_skip]:num_entries]

HTTP Query Parameters

These are a convenience alternative to the headers shown above as query parameters are easier to use in development and with the Home Assistant proxy. You should only provide one or the other.

Querytypedescription
verboseN/AIf included, uses text/x-log as log output type (alternative to Accept header)
linesintNumber of lines of output to return (alternative to Range header)
no_colorsN/AIf included, ANSI escape codes for terminal coloring will be stripped from the output

查询字符串示例:

?verbose&lines=100&no_colors
Tip

To get the last log entries the Range request header supports negative values as num_skip. E.g. Range: entries=:-9: returns the last 10 entries. Or Range: entries=:-200:100 to see 100 entries starting from the one 200 ago.

API returns the last 100 lines by default. Provide a value for Range to see logs further in the past.

The Accept header can be set to text/x-log to get logs annotated with extra information, such as the timestamp and Systemd unit name. If no identifier is specified (i.e. for the host logs containing logs for multiple identifiers/units), this option is ignored - these logs are always annotated.

Identical to /host/logs except it continuously returns new log entries.

Returns a list of syslog identifiers from the systemd journal that you can use with /host/logs/identifiers/<identifier> and /host/logs/boots/<bootid>/identifiers/<identifier>.

Get systemd Journal logs from the host for entries related to a specific log identifier. Some examples of useful identifiers here include

  • audit - If developing an apparmor profile shows you permission issues
  • NetworkManager - Shows NetworkManager logs when having network issues
  • bluetoothd - Shows bluetoothd logs when having bluetooth issues

A call to GET /host/logs/identifiers will show the complete list of possible values for identifier.

Otherwise it provides the same functionality as /host/logs.

Identical to /host/logs/identifiers/<identifier> except it continuously returns new log entries.

Returns a dictionary of boot IDs for this system that you can use with /host/logs/boots/<bootid> and /host/logs/boots/<bootid>/identifiers/<identifier>.

The key for each item in the dictionary is the boot offset. 0 is the current boot, a negative number denotes how many boots ago that boot was.

Get systemd Journal logs from the host for entries related to a specific boot. Call GET /host/info/boots to see the boot IDs. Alternatively you can provide a boot offset:

  • 0 - The current boot
  • Negative number - Count backwards from current boot (-1 is previous boot)
  • Positive number - Count forward from last known boot (1 is last known boot)

Otherwise it provides the same functionality as /host/logs.

Identical to /host/logs/boots/<bootid> except it continuously returns new log entries.

Get systemd Journal logs entries for a specific log identifier and boot. A combination of /host/logs/boots/<bootid> and /host/logs/identifiers/<identifier>.

Identical to /host/logs/boots/<bootid>/identifiers/<identifier> except it continuously returns new log entries.

Set host options

负载:

keytypeoptionaldescription
hostnamestringTrueA string that will be used as the new hostname

你至少需要在负载中提供一个键。

Reboot the host

负载:

keytypeoptionaldescription
forcebooleanTrueForce reboot during a Home Assistant offline db migration
Reload host information Start a service on the host. Stop a service on the host. Reload a service on the host. Get information about host services.

返回数据:

keydescription
servicesA dictionary of Host service models

示例响应:

{
  "services": [
    {
      "name": "awesome.service",
      "description": "Just an awesome service",
      "state": "active"
    }
  ]
}
Shutdown the host

负载:

keytypeoptionaldescription
forcebooleanTrueForce shutdown during a Home Assistant offline db migration
Get detailed disk usage information in bytes.

The only supported disk for now is "default". It will return usage info for the data disk.

Supports an optional max_depth query param. Defaults to 1

示例响应:

{
  "id": "root",
  "label": "Default",
  "total_space": 503312781312,
  "used_space": 430245011456,
  "children": [
    {
      "id": "system",
      "label": "System",
      "used_space": 75660903137
    },
    {
      "id": "addons_data",
      "label": "Addons data",
      "used_space": 42349200762
    },
    {
      "id": "addons_config",
      "label": "Addons configuration",
      "used_space": 5283318814
    },
    {
      "id": "media",
      "label": "Media",
      "used_space": 476680019
    },
    {
      "id": "share",
      "label": "Share",
      "used_space": 37477206419
    },
    {
      "id": "backup",
      "label": "Backup",
      "used_space": 268350699520
    },
    {
      "id": "ssl",
      "label": "SSL",
      "used_space": 202912633
    },
    {
      "id": "homeassistant",
      "label": "Home assistant",
      "used_space": 444090152
    }
  ]
}

Ingress

返回数据:

keytypedescription
panelsdictionarydictionary of Panel models

示例响应:

{
  "panels": {
    "addon_slug": {
      "enable": true,
      "icon": "mdi:awesome-icon",
      "title": "Awesome app",
      "admin": true
    }
  }
}
Create a new session for access to the ingress service.

负载:

keytypeoptionaldescription
user_idstringTrueThe ID of the user authenticated for the new session

返回数据:

keytypeoptionaldescription
sessionstringFalseThe token for the ingress session
Validate an ingress session, extending it's validity period.

负载:

keytypeoptionaldescription
sessionstringFalseThe token for the ingress session

任务

Returns info on ignored job conditions and currently running or completed jobs

返回数据:

keytypedescription
ignore_conditionslistList of job conditions being ignored
jobslistList of running or completed Jobs

示例响应:

{
  "ignore_conditions": [],
  "jobs": [{
    "name": "backup_manager_full_backup",
    "reference": "a01bc3",
    "uuid": "123456789",
    "progress": 0,
    "stage": "addons",
    "done": false,
    "child_jobs": [],
    "extra": null
  }]
}
Set options for job manager

负载:

keytypedescription
ignore_conditionslistList of job conditions to ignore (replaces existing list)
Returns info on a currently running or completed job

返回数据:

See Job model

示例响应:

{
  "name": "backup_manager_full_backup",
  "reference": "a01bc3",
  "uuid": "123456789",
  "progress": 0,
  "stage": "addons",
  "done": false,
  "child_jobs": [],
  "extra": null
}
Removes a completed job from Supervisor cache if client is no longer interested in it Reset job manager to defaults (stops ignoring any ignored job conditions)

Returns information about available updates

示例响应:

{
  "available_updates": [
  {
      "panel_path": "/update-available/core",
      "update_type": "core",
      "version_latest": "321",
    },
    {
      "panel_path": "/update-available/os",
      "update_type": "os",
      "version_latest": "321",
    },
    {
      "panel_path": "/update-available/supervisor",
      "update_type": "supervisor",
      "version_latest": "321",
    },
    {
      "name": "Awesome addon",
      "icon": "/addons/awesome_addon/icon",
      "panel_path": "/update-available/awesome_addon",
      "update_type": "addon",
      "version_latest": "321",
    }
  ]
}

返回数据:

keytypedescription
update_typestringaddon, os, core or supervisor
namestringReturns the name (only if the update_type is addon)
iconstringReturns the path for the icon if any (only if the update_type is addon)
version_lateststringReturns the available version
panel_pathstringReturns path where the UI can be loaded
This reloads information about main components (OS, Supervisor, Core, and Plug-ins). This reloads information about app repositories and fetches new version files. This endpoint is currently discouraged. Use `/reload_updates` or `/store/reload` instead. Returns a dict with selected keys from other `/*/info` endpoints.

返回数据:

keytypedescription
supervisorstringThe installed version of the supervisor
homeassistantstringThe installed version of Home Assistant
hassosstring or nullThe version of Home Assistant OS or null
dockerstringThe docker version on the host
hostnamestringThe hostname on the host
operating_systemstringThe operating system on the host
featureslistA list ov available features on the host
machinestringThe machine type
machine_idstring or nullThe machine ID of the underlying operating system
archstringThe architecture on the host
supported_archlistA list of supported host architectures
supportedbooleantrue if the environment is supported
channelstringThe active channel (stable, beta, dev)
loggingstringThe active log level (debug, info, warning, error, critical)
statestringThe core state of the Supervisor.
timezonestringThe current timezone

示例响应:

{
  "supervisor": "300",
  "homeassistant": "0.117.0",
  "hassos": "5.0",
  "docker": "24.17.2",
  "hostname": "Awesome Hostname",
  "operating_system": "Home Assistant OS",
  "features": ["shutdown", "reboot", "hostname", "services", "hassos"],
  "machine": "ova",
  "arch": "amd64",
  "supported_arch": ["amd64"],
  "supported": true,
  "channel": "stable",
  "logging": "info",
  "state": "running",
  "timezone": "Europe/Brussels"
}

挂载

Returns information about mounts configured in Supervisor

返回数据:

keytypedescription
mountslistA list of Mounts
default_backup_mountstring or nullName of a backup mount or null for /backup

示例响应:

{
  "default_backup_mount": "my_share",
  "mounts": [
    {
      "name": "my_share",
      "usage": "media",
      "type": "cifs",
      "server": "server.local",
      "share": "media",
      "state": "active",
      "read_only": false
    }
  ]
}
Set mount manager options

负载:

keytypeoptionaldescription
default_backup_mountstring or nullTrueName of a backup mount or null for /backup

你至少需要在负载中提供一个键。

Add a new mount in Supervisor and mount it

负载:

Accepts a Mount

Value in name must be unique and can only consist of letters, numbers and underscores.

示例负载:

{
  "name": "my_share",
  "usage": "media",
  "type": "cifs",
  "server": "server.local",
  "share": "media",
  "username": "admin",
  "password": "password",
  "read_only": false
}
Update an existing mount in Supervisor and remount it

负载:

Accepts a Mount.

The name field should be omitted. If included the value must match the existing name, it cannot be changed. Delete and re-add the mount to change the name.

示例负载:

{
  "usage": "media",
  "type": "nfs",
  "server": "server.local",
  "path": "/media/camera",
  "read_only": true
}
Unmount and delete an existing mount from Supervisor. Unmount and remount an existing mount in Supervisor using the same configuration.

组播

Returns information about the multicast plugin

返回数据:

keytypedescription
versionstringThe installed multicast version
version_lateststringThe latest published version
update_availablebooleantrue if an update is available

示例响应:

{
  "version": "1",
  "version_latest": "2",
  "update_available": true
}

Get logs for the multicast plugin via the Systemd journal backend.

The endpoint accepts the same headers and provides the same functionality as /host/logs.

Identical to /multicast/logs except it continuously returns new log entries.

Return all logs of the latest startup of the multicast plugin container.

The Range header is ignored but the lines query parameter can be used.

Get logs for the multicast plugin related to a specific boot.

The bootid parameter is interpreted in the same way as in /host/logs/boots/<bootid> and the endpoint otherwise provides the same functionality as /host/logs.

Identical to /multicast/logs/boots/<bootid> except it continuously returns new log entries.

Restart the multicast plugin.

Returns a Stats model for the multicast plugin.

示例响应:

{
  "cpu_percent": 14.0,
  "memory_usage": 288888,
  "memory_limit": 322222,
  "memory_percent": 32.4,
  "network_tx": 110,
  "network_rx": 902,
  "blk_read": 12,
  "blk_write": 27
}
Update the multicast plugin

负载:

keytypedescription
versionstringThe version you want to install, default is the latest version

网络

Get network information.

返回数据:

keydescription
interfacesA list of Network interface models
dockerInformation about the internal docker network
host_internetBoolean to indicate if the host can reach the internet.
supervisor_internetBoolean to indicate if the Supervisor can reach the internet.

示例响应:

{
  "interfaces": [
    {
      "interface": "eth0",
      "type": "ethernet",
      "primary": true,
      "enabled": true,
      "connected": true,
      "ipv4": {
        "method": "static",
        "ip_address": "192.168.1.100/24",
        "gateway": "192.168.1.1",
        "nameservers": ["192.168.1.1"],
      },
      "ipv6": null,
      "wifi": null,
      "vlan": null,
    }
  ],
  "docker": {
    "interface": "hassio",
    "address": "172.30.32.0/23",
    "gateway": "172.30.32.1",
    "dns": "172.30.32.3"
  },
  "host_internet": true,
  "supervisor_internet": true
}

Returns a Network interface model for a specific network interface.

Update all Network interface data.

Update the settings for a network interface.

负载:

keytypeoptionaldescription
enabledboolTrueEnable/Disable an ethernet interface / VLAN got removed with disabled
ipv6dictTrueA struct with ipv6 interface settings
ipv4dictTrueA struct with ipv4 interface settings
wifidictTrueA struct with Wireless connection settings

ipv6:

keytypeoptionaldescription
methodstringTrueSet IP configuration method can be auto for DHCP or Router Advertisements, static or disabled
addr_gen_modestringTrueAddress generation mode can be eui64, stable-privacy, default-or-eui64 or default
ip6_privacystringTruePrivacy extensions options are disabled, enabled-prefer-public, enabled or default
addresslistTrueThe new IP address for the interface in the ::/XX format as list
nameserverslistTrueList of DNS servers to use
gatewaystringTrueThe gateway the interface should use
route_metricintTrueRoute metric. Lower value has higher priority. The kernel accepts zero (0) but coerces it to 1024 (user default)

ipv4:

keytypeoptionaldescription
methodstringTrueSet IP configuration method can be auto for DHCP, static or disabled
addresslistTrueThe new IP address for the interface in the X.X.X.X/XX format as list
nameserverslistTrueList of DNS servers to use
gatewaystringTrueThe gateway the interface should use
route_metricintTrueRoute metric. Lower value has higher priority

wifi:

keytypeoptionaldescription
modestringTrueSet the mode infrastructure (default), mesh, adhoc or ap
authstringTrueSet the auth mode: open (default), web, wpa-psk
ssidstringTrueSet the SSID for connect into
pskstringTrueThe shared key which is used with web or wpa-psk

Return a list of available Access Points on this Wireless interface.

This function only works with Wireless interfaces!

返回数据:

keydescription
accesspointsA list of Access Points

示例响应:

{
  "accesspoints": [
    {
      "mode": "infrastructure",
      "ssid": "MY_TestWifi",
      "mac": "00:00:00:00",
      "frequency": 24675,
      "signal": 90
    }
  ]
}

Create a new VLAN id on this network interface.

This function only works with ethernet interfaces!

负载:

keytypeoptionaldescription
ipv6dictTrueA struct with ipv6 interface settings
ipv4dictTrueA struct with ipv4 interface settings

Observer

Returns information about the observer plugin

返回数据:

keytypedescription
hoststringThe IP address of the plugin
versionstringThe installed observer version
version_lateststringThe latest published version
update_availablebooleantrue if an update is available

示例响应:

{
  "host": "172.0.0.17",
  "version": "1",
  "version_latest": "2",
  "update_available": true
}

Returns a Stats model for the observer plugin.

示例响应:

{
  "cpu_percent": 14.0,
  "memory_usage": 288888,
  "memory_limit": 322222,
  "memory_percent": 32.4,
  "network_tx": 110,
  "network_rx": 902,
  "blk_read": 12,
  "blk_write": 27
}

Update the observer plugin

负载:

keytypedescription
versionstringThe version you want to install, default is the latest version

OS

Load host configurations from a USB stick.

Returns information about the OS.

返回数据:

keytypedescription
versionstringThe current version of the OS
version_lateststringThe latest published version of the OS in the active channel
update_availablebooleantrue if an update is available
boardstringThe name of the board
bootstringWhich slot that are in use
data_diskstringDevice which is used for holding OS data persistent
boot_slotsdictDictionary of boot slots keyed by name

示例响应:

{
  "version": "4.3",
  "version_latest": "5.0",
  "update_available": true,
  "board": "ova",
  "boot": "slot1",
  "data_disk": "BJTD4R-0x123456789",
  "boot_slots": {
    "A": {
      "state": "inactive",
      "status": "good",
      "version": "10.1"
    },
    "B": {
      "state": "active",
      "status": "good",
      "version": "10.2"
    }
  }
}

Update Home Assistant OS

负载:

keytypedescription
versionstringThe version you want to install, default is the latest version

Change the active boot slot, This will also reboot the device!

负载:

keytypedescription
boot_slotstringBoot slot to change to. See options in boot_slots from /os/info API.

Get current HAOS swap configuration. Unavailable on Supervised.

返回数据:

keytypedescription
swap_sizestringCurrent swap size.
swappinessintCurrent kernel swappiness value.

示例响应:

{
  "swap_size": "2G",
  "swappiness": 1
}

Set HAOS swap configuration. Unavailable on Supervised.

负载:

keytypedescription
swap_sizestringNew swap siz as number with optional units (K/M/G). Anything lower than 40K disables swap.
swappinessintNew swappiness value (0-100).

Returns possible targets for the new data partition.

返回数据:

keytypedescription
deviceslistList of IDs of possible data disk targets
diskslistList of disks which are possible data disk targets

示例响应:

{
  "devices": [
    "Generic-Flash-Disk-123ABC456",
    "SSK-SSK-Storage-ABC123DEF"
  ],
  "disks": [
    {
      "name": "Generic Flash Disk (123ABC456)",
      "vendor": "Generic",
      "model": "Flash Disk",
      "serial": "123ABC456",
      "size": 8054112256,
      "id": "Generic-Flash-Disk-123ABC456",
      "dev_path": "/dev/sda"
    },
    {
      "name": "SSK SSK Storage (ABC123DEF)",
      "vendor": "SSK",
      "model": "SSK Storage",
      "serial": "ABC123DEF",
      "size": 250059350016,
      "id": "SSK-SSK-Storage-ABC123DEF",
      "dev_path": "/dev/sdb"
    }
  ]
}

Move datadisk to a new location, This will also reboot the device!

负载:

keytypedescription
devicestringID of the disk device which should be used as the target for the data migration

Wipe the datadisk including all user data and settings, This will also reboot the device! This API requires an admin token

This API will wipe all config/settings for addons, Home Assistant and the Operating System and any locally stored data in config, backups, media, etc. The machine will reboot during this.

After the reboot completes the latest stable version of Home Assistant and Supervisor will be downloaded. Once the process is complete the user will see onboarding, like during initial setup.

This wipe also includes network settings. So after the reboot the user may need to reconfigure those in order to access Home Assistant again.

The operating system version as well as its boot configuration will be preserved.

Returns information about your board if it has features or settings that can be modified from Home Assistant. The value for board is the value in the board field returned by /os/info.

Boards with such options are documented below.

If running on a yellow board, returns current values for its settings.

返回数据:

keytypedescription
disk_ledbooleanIs the disk LED enabled
heartbeat_ledbooleanIs the heartbeat LED enabled
power_ledbooleanIs the power LED enabled

示例响应:

{
  "disk_led": true,
  "heartbeat_led": true,
  "power_led": false
}

If running on a yellow board, changes one or more of its settings.

负载:

keytypedescription
disk_ledbooleanEnable/disable the disk LED
heartbeat_ledbooleanEnable/disable the heartbeat LED
power_ledbooleanEnable/disable the power LED

If running on a green board, returns current values for its settings.

返回数据:

keytypedescription
activity_ledbooleanIs the green activity LED enabled
power_ledbooleanIs the white power LED enabled
system_health_ledbooleanIs the yellow system health LED enabled

示例响应:

{
  "activity_led": true,
  "power_led": true,
  "system_health_led": false
}

If running on a green board, changes one or more of its settings.

负载:

keytypedescription
activity_ledbooleanEnable/disable the green activity LED
power_ledbooleanEnable/disable the white power LED
system_health_ledbooleanEnable/disable the yellow system health LED

解析中心

返回数据:

keytypedescription
unsupportedlistA list of reasons why an installation is marked as unsupported (container, dbus, docker_configuration, docker_version, lxc, network_manager, os, privileged, systemd)
unhealthylistA list of reasons why an installation is marked as unhealthy (docker, supervisor, privileged, setup)
issueslistA list of Issue models
suggestionslistA list of Suggestion models actions
checkslistA list of Check models

示例响应:

{
  "unsupported": ["os"],
  "unhealthy": ["docker"],
  "issues": [
    {
      "uuid": "A89924620F9A11EBBDC3C403FC2CA371",
      "type": "free_space",
      "context": "system",
      "reference": null
     }
  ],
  "suggestions": [
    {
      "uuid": "B9923620C9A11EBBDC3C403FC2CA371",
      "type": "clear_backups",
      "context": "system",
      "reference": null,
      "auto": false
    }
  ],
  "checks": [
    {
      "slug": "free_space",
      "enabled": true
    }
  ]
}

Apply a suggested action

Dismiss a suggested action

Get suggestions that would fix an issue if applied.

返回数据:

keytypedescription
suggestionslistA list of Suggestion models actions

示例响应:

{
  "suggestions": [
    {
      "uuid": "B9923620C9A11EBBDC3C403FC2CA371",
      "type": "clear_backups",
      "context": "system",
      "reference": null,
      "auto": false
    }
  ]
}

Dismiss an issue

Execute a healthcheck and autofix & notification.

Set options for this check.

负载:

keytypedescription
enabledboolIf the check should be enabled or disabled

Execute a specific check right now.

服务

返回数据:

keytypedescription
servicesdictionarydictionary of Service models

示例响应:

{
  "services": [
    {
      "slug": "name",
      "available": true,
      "providers": ["awesome_addon"]
    }
  ]
}

返回数据:

keytypedescription
addonstringThe app slug
hoststringThe IP of the addon running the service
portstringThe port the service is running on
sslbooleantrue if SSL is in use
usernamestringThe username for the service
passwordstringThe password for the service
protocolstringThe MQTT protocol

示例响应:

{
  "addon": "awesome_mqtt",
  "host": "172.0.0.17",
  "port": "8883",
  "ssl": true,
  "username": "awesome_user",
  "password": "strong_password",
  "protocol": "3.1.1"
}

Create a service definition

负载:

keytypedescription
hoststringThe IP of the addon running the service
portstringThe port the service is running on
sslbooleantrue if SSL is in use
usernamestringThe username for the service
passwordstringThe password for the service
protocolstringThe MQTT protocol

Deletes the service definitions

返回数据:

keytypedescription
addonstringThe app slug
hoststringThe IP of the addon running the service
portstringThe port the service is running on
sslbooleantrue if SSL is in use
usernamestringThe username for the service
passwordstringThe password for the service
protocolstringThe MQTT protocol

示例响应:

{
  "addon": "awesome_mysql",
  "host": "172.0.0.17",
  "port": "8883",
  "username": "awesome_user",
  "password": "strong_password"
}

Create a service definition

负载:

keytypedescription
hoststringThe IP of the addon running the service
portstringThe port the service is running on
usernamestringThe username for the service
passwordstringThe password for the service

Deletes the service definitions

商店

Returns app store information.

示例响应:

{ "addons":
  [
    {
      "name": "Awesome app",
      "slug": "7kshd7_awesome",
      "description": "Awesome description",
      "repository": "https://example.com/addons",
      "version": "1.0.0",
      "installed": "1.0.0",
      "icon": false,
      "logo": true,
      "state": "started"
    }
  ],
  "repositories": [
    {
      "slug": "awesom_repository",
      "name": "Awesome Repository",
      "source": "https://example.com/addons",
      "url": "https://example.com/addons",
      "maintainer": "Awesome Maintainer"
    }
  ]
}

Returns a list of store apps

示例响应:

[
  {
    "name": "Awesome app",
    "slug": "7kshd7_awesome",
    "description": "Awesome description",
    "repository": "https://example.com/addons",
    "version": "1.0.0",
    "installed": "1.0.0",
    "icon": false,
    "logo": true,
    "state": "started"
  }
]

Returns information about a store app

示例响应:

{
  "advanced": false,
  "apparmor": "default",
  "arch": ["armhf", "aarch64", "i386", "amd64"],
  "auth_api": true,
  "available": true,
  "build": false,
  "description": "Awesome description",
  "detached": false,
  "docker_api": false,
  "documentation": true,
  "full_access": true,
  "hassio_api": false,
  "hassio_role": "manager",
  "homeassistant_api": true,
  "homeassistant": "2021.2.0b0",
  "host_network": false,
  "host_pid": false,
  "icon": false,
  "ingress": true,
  "installed": false,
  "logo": true,
  "long_description": "lorem ipsum",
  "name": "Awesome app",
  "rating": 5,
  "repository": "core",
  "signed": false,
  "slug": "7kshd7_awesome",
  "stage": "stable",
  "update_available": false,
  "url": "https://example.com/addons/tree/main/awesome_addon",
  "version_latest": "1.0.0",
  "version": "1.0.0"
}

Install an app from the store.

负载:

keytypedescription
backgroundbooleanReturn job_id immediately, do not wait for install to complete. Clients must check job for status

Update an app from the store.

负载:

keytypedescription
backupbooleanCreate a partial backup of the app, default is false
backgroundbooleanReturn job_id immediately, do not wait for update to complete. Clients must check job for status
Get the changelog for an app. Get the documentation for an app. Get the app icon Get the app logo

Returns 200 success status if the latest version of the app is able to be installed on the current system. Returns a 400 error status if it is not with a message explaining why.

Reloads the information stored about apps.

Returns a list of store repositories

示例响应:

[
  {
    "slug": "awesom_repository",
    "name": "Awesome Repository",
    "source": "https://example.com/addons",
    "url": "https://example.com/addons",
    "maintainer": "Awesome Maintainer"
  }
]

Add an addon repository to the store

负载:

keytypedescription
repositorystringURL of the addon repository to add to the store.

示例负载:

{
  "repository": "https://example.com/addons"
}

Returns information about a store repository

示例响应:

{
  "slug": "awesom_repository",
  "name": "Awesome Repository",
  "source": "https://example.com/addons",
  "url": "https://example.com/addons",
  "maintainer": "Awesome Maintainer"
}

Remove an unused addon repository from the store.

Repair/reset an addon repository in the store that is missing or showing incorrect information.

安全

Returns information about the security features

返回数据:

keytypedescription
pwnedboolIf pwned check is enabled or disabled on the backend
force_securityboolIf force-security is enabled or disabled on the backend

示例响应:

{
  "pwned": true,
  "force_security": false,
}

负载:

keytypedescription
pwnedboolDisable/Enable pwned
force_securityboolDisable/Enable force-security

Supervisor

Returns information about the supervisor

返回数据:

keytypedescription
versionstringThe installed supervisor version
version_lateststringThe latest published version in the active channel
update_availablebooleantrue if an update is available
archstringThe architecture of the host (armhf, aarch64, i386, amd64)
channelstringThe active channel (stable, beta, dev)
timezonestringThe current timezone
healthyboolThe supervisor is in a healthy state
supportedboolThe environment is supported
loggingstringThe current log level (debug, info, warning, error, critical)
ip_addressstringThe internal docker IP address to the supervisor
wait_bootintMax time to wait during boot
debugboolDebug is active
debug_blockbooltrue if debug block is enabled
diagnosticsbool or nullSending diagnostics is enabled
addons_repositorieslistA list of app repository URL's as strings
auto_updateboolIs auto update enabled for supervisor
detect_blocking_ioboolSupervisor raises exceptions for blocking I/O in event loop

示例响应:

{
  "version": "246",
  "version_latest": "version_latest",
  "update_available": true,
  "arch": "amd64",
  "channel": "dev",
  "timezone": "TIMEZONE",
  "healthy": true,
  "supported": false,
  "logging": "debug",
  "ip_address": "172.0.0.2",
  "wait_boot": 800,
  "debug": false,
  "debug_block": false,
  "diagnostics": null,
  "addons_repositories": ["https://example.com/addons"],
  "auto_update": true,
  "detect_blocking_io": false
}

Get logs for the Supervisor container via the Systemd journal backend. If the Systemd journal gateway fails to provide the logs, raw Docker container logs are returned as the fallback.

The endpoint accepts the same headers and provides the same functionality as /host/logs.

Identical to /supervisor/logs except it continuously returns new log entries.

Return all logs of the latest startup of the Supervisor container.

The Range header is ignored but the lines query parameter can be used.

Get logs for the Supervisor container related to a specific boot.

The bootid parameter is interpreted in the same way as in /host/logs/boots/<bootid> and the endpoint otherwise provides the same functionality as /host/logs.

Identical to /supervisor/logs/boots/<bootid> except it continuously returns new log entries.

Update options for the supervisor, you need to supply at least one of the payload keys to the API call. You need to call /supervisor/reload after updating the options.

负载:

keytypedescription
channelstringSet the active channel (stable, beta, dev)
timezonestringSet the timezone
wait_bootintSet the time to wait for boot
debugboolEnable debug
debug_blockboolEnable debug block
loggingstringSet logging level
addons_repositorieslistSet a list of URL's as strings for app repositories
auto_updateboolEnable/disable auto update for supervisor
detect_blocking_iostringEnable blocking I/O in event loop detection. Valid values are on, off and on_at_startup.

Ping the supervisor to check if it can return a response.

Reload parts of the supervisor, this enable new options, and check for updates.

Restart the supervisor, can help to get the supervisor healthy again.

Repair docker overlay issues, and lost images.

Returns a Stats model for the supervisor.

示例响应:

{
  "cpu_percent": 14.0,
  "memory_usage": 288888,
  "memory_limit": 322222,
  "memory_percent": 32.4,
  "network_tx": 110,
  "network_rx": 902,
  "blk_read": 12,
  "blk_write": 27
}

Update the supervisor

负载:

keytypedescription
versionstringThe version to install. Defaults to the latest version. Development only: Only works in the Supervisor development environment.

占位符

Some of the endpoints uses placeholders indicated with <...> in the endpoint URL.

placeholderdescription
addonThe slug for the addon, to get the slug you can call /addons, to call endpoints for the app calling the endpoints you can use selfas the slug.
applicationThe name of an application, call /audio/info to get the correct name
backupA valid backup slug, example skuwe823, to get the slug you can call /backups
bootidAn id or offset of a particular boot, used to filter logs. Call /host/logs/boots to get a list of boot ids or see /host/logs/boots/<bootid> to understand boot offsets
checkThe slug of a system check in Supervisor's resolution manager. Call /resolution/info for a list of options from the checks field
diskIdentifier of a disk attached to host or default. See /host/disks/<disk>/usage for more details
idNumeric id of a vlan on a particular interface. See /network/interface/<interface>/vlan/<id> for details
identifierA syslog identifier used to filter logs. Call /host/logs/identifiers to get a list of options. See /host/logs/identifiers/<identifier> for some common examples
interfaceA valid interface name, example eth0, to get the interface name you can call /network/info. You can use default to get the primary interface
issueThe UUID of an issue with the system identified by Supervisor. Call /resolution/info for a list of options from the issues field
job_idThe UUID of a currently running or completed Supervisor job
nameName of a mount added to Supervisor. Call /mounts to get a list of options from mounts field
registryA registry hostname defined in the container registry configuration, to get the hostname you can call /docker/registries
repositoryThe slug of an addon repository added to Supervisor. Call /store for a list of options from the repositories field
serviceThe service name for a service on the host.
suggestionThe UUID of a suggestion for a system issue identified by Supervisor. Call /resolution/info for a list of options from the suggestions field
uuidThe UUID of a discovery service, to get the UUID you can call /discovery