Bashio: Supervisor and system
Bashio functions that wrap the Supervisor API for the Supervisor itself, system information, updates, jobs, backups, repositories, mounts, Docker, and security.
These functions wrap the Supervisor endpoints, the backup endpoints, and the store and Docker parts of the Supervisor API. The function lists on this page are generated from the docblocks in the source of Bashio. The descriptions are the ones in the source, so some still say "addon" where this site says app.
Many of them need hassio_api: true and a role that allows the call, see what your app may call. bashio::supervisor.ping and the bashio::info.* functions work for every app.
The functions without arguments read one value from a cached answer of the API. The functions with a cache key and a jq filter as arguments return the whole JSON object, or the part your filter selects.
#!/command/with-contenv bashio
bashio::log.info "Running on $(bashio::info.operating_system)"
bashio::log.info "Supervisor $(bashio::supervisor.version)"bashio::api.supervisor is the function all the others use. Call it directly for an endpoint that has no function of its own. It adds the token, checks the HTTP status, and returns the data part of the answer.
The low-level call to the Supervisor API. Source: lib/api.sh.
bashio::api.supervisor: Makes a call to the Supervisor API.$1: HTTP Method (GET/POST)$2: API Resource requested$3: For GET: whether this resource returns raw data instead of JSON (optional) For POST: the JSON document to send as the request body (optional)$4: jq filter command (optional)
The Supervisor itself: version, updates, settings, logs, and resource usage. Source: lib/supervisor.sh.
bashio::supervisor.ping: Check to see if the Supervisor is still alive.bashio::supervisor.update: Updates the Supervisor to the latest version.$1: Version to update to (optional)
bashio::supervisor.reload: Reloads the Supervisor.bashio::supervisor.restart: Restarts the Supervisor.bashio::supervisor.repair: Repairs the Supervisor.bashio::supervisor.logs: Returns the logs created by the Supervisor.bashio::supervisor.logs_latest: Returns all logs of the latest startup of the Supervisor.bashio::supervisor: Returns a JSON object with generic version information about the system.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::supervisor.version: Returns the Home Assistant Supervisor version used.bashio::supervisor.version_latest: Returns the latest version of the Supervisor.bashio::supervisor.update_available: Checks if there is an update available for the Supervisor.bashio::supervisor.arch: Returns the architecture of the system.bashio::supervisor.supported: Returns the supported state of the system.bashio::supervisor.healthy: Returns the healthy state of the system.bashio::supervisor.channel: Returns or sets the stability channel of the setup.$1: Stability channel to switch to: stable, beta or dev (optional).
bashio::supervisor.timezone: Returns or sets the current timezone of the system.$1: Timezone to set (optional).
bashio::supervisor.country: Returns or sets the current country of the system.$1: Country to set (optional).
bashio::supervisor.logging: Returns or sets the current logging level of the Supervisor.$1: Logging level to set (optional).
bashio::supervisor.ip_address: Returns the ip address of the supervisor.bashio::supervisor.debug: Returns or sets if debug is enabled on the Supervisor.$1: Set debug (optional).
bashio::supervisor.debug_block: Returns or sets if debug block is enabled on the Supervisor.$1: Set debug block (optional).
bashio::supervisor.diagnostics: Returns or sets if sending diagnostics is enabled on the Supervisor.$1: Set diagnostics (optional).
bashio::supervisor.auto_update: Returns or sets if auto update is enabled on the Supervisor.$1: Set auto update (optional).
bashio::supervisor.detect_blocking_io: Returns or sets if the Supervisor raises exceptions for blocking I/O in the event loop.$1: Set detect blocking I/O (optional). (valid values are on, off and on-at-startup)
bashio::supervisor.addons: Returns a list of app slugs of the apps installed.bashio::supervisor.addons_repositories: Returns a list of app repositories installed.bashio::supervisor.stats: List all available stats about the Supervisor.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::supervisor.cpu_percent: Returns CPU usage from the Supervisor.bashio::supervisor.memory_usage: Returns memory usage from the Supervisor.bashio::supervisor.memory_limit: Returns memory limit from the Supervisor.bashio::supervisor.memory_percent: Returns memory usage in percent from the Supervisor.bashio::supervisor.network_tx: Returns outgoing network usage from the Supervisor.bashio::supervisor.network_rx: Returns incoming network usage from the Supervisor.bashio::supervisor.blk_read: Returns disk read usage from the Supervisor.bashio::supervisor.blk_write: Returns disk write usage from the Supervisor.
General information about the system, from /info. Source: lib/info.sh.
bashio::info: Returns a JSON object with generic version information about the system.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::info.supervisor: Returns the Home Assistant Supervisor version used.bashio::info.homeassistant: Returns the Home Assistant version used.bashio::info.hassos: Returns the hassos version running on the host system.bashio::info.hostname: Returns the hostname of the host system.bashio::info.machine: Returns the machine type used.bashio::info.arch: Returns the architecture of the machine.bashio::info.channel: Returns the stability channel the system is enrolled in.bashio::info.supported_arch: Returns a list of supported architectures by this system.bashio::info.logging: Returns logging level of Supervisor universum.bashio::info.timezone: Returns timezone of the system.bashio::info.supported: Returns the supported state of the system.bashio::info.docker: Returns the Docker version running on the system.bashio::info.operating_system: Returns the operating system running on the system.bashio::info.state: Returns the current state of Home Assistant Supervisor
Available updates for the whole system. Source: lib/updates.sh.
bashio::updates: Returns a JSON object listing the components that have an update available.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::updates.refresh: Refreshes the cache of the latest software versions from the version server.bashio::updates.reload: Reloads the add-on stores and reads the latest version information.
Jobs the Supervisor runs, from /jobs. Source: lib/jobs.sh.
bashio::jobs.reset: Reset job manager.bashio::jobs.options: Sets the job manager options.$1: Options object (JSON)
bashio::jobs: Returns a JSON object with information about jobs.$1: Job uuid (optional) (default/empty/'false' for all jobs)$2: Cache key to store filtered results in (optional) (default/empty/'false' for no caching)$3: jq filter to apply on the result (optional) (default/empty is '.jobs[].uuid' with no uuid or 'false' with uuid) ('false' for no filtering)
bashio::job.name: Returns the name of a job.$1: Job uuid
bashio::job.reference: Returns the reference of a job.$1: Job uuid
bashio::job.progress: Returns the progress of a job.$1: Job uuid
bashio::job.stage: Returns the stage of a job.$1: Job uuid
bashio::job.done: Returns whether a job is done.$1: Job uuid
bashio::job.created: Returns the creation timestamp of a job.$1: Job uuid
bashio::job.child_jobs: Returns the child jobs for a job.$1: Job uuid
bashio::job.errors: Returns the errors of a job.$1: Job uuid
bashio::job.extra: Returns the extra metadata for a job.$1: Job uuid
bashio::job.delete: Removes a completed job from Supervisor cache.$1: Job uuid
Issues, suggestions, and checks of the resolution center, from /resolution. Source: lib/resolution.sh.
bashio::resolution: Returns a JSON object with information from the resolution center.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::resolution.unsupported: Returns a list of unsupported reasons.bashio::resolution.unhealthy: Returns a list of unhealthy reasons.bashio::resolution.issues: Returns the list of current issues from the resolution center.bashio::resolution.suggestions: Returns the list of current suggestions from the resolution center.bashio::resolution.checks: Returns the list of available checks from the resolution center.bashio::resolution.suggestion.apply: Applies a suggestion offered by the resolution center.$1: UUID of the suggestion to apply
bashio::resolution.suggestion.dismiss: Dismisses a suggestion offered by the resolution center.$1: UUID of the suggestion to dismiss
bashio::resolution.issue.dismiss: Dismisses an issue reported by the resolution center.$1: UUID of the issue to dismiss
bashio::resolution.check: Executes a check from the resolution center.$1: Slug of the check to run
bashio::resolution.healthcheck: Runs a backend healthcheck via the resolution center.
Make, restore, and inspect backups, from /backups. Source: lib/backups.sh.
bashio::backups.reload: Reloads the backups.bashio::backups.freeze: Freezes the backups.$1: Timeout (optional)
bashio::backups.thaw: End a freeze initiated bybashio::backups.freeze().bashio::backups.days_until_stale: Returns or sets the number of days until a backup is considered stale.$1: Set days_until_stale (optional)
bashio::backups: Returns a JSON object with information about backups.$1: Backup slug (optional) (default/empty/'false' for all backups)$2: Cache key to store filtered results in (optional) (default/empty/'false' for no caching)$3: jq filter to apply on the result (optional) (default/empty is '.backups[].slug' with no slug or 'false' with slug) ('false' for no filtering)
bashio::backup.type: Returns the type of a backup.$1: Backup slug
bashio::backup.name: Returns the name of a backup.$1: Backup slug
bashio::backup.date: Returns the date of a backup.$1: Backup slug
bashio::backup.size: Returns the size of a backup in megabytes.$1: Backup slug
bashio::backup.size_bytes: Returns the size of a backup in bytes.$1: Backup slug
bashio::backup.protected: Returns if the backup is protected.$1: Backup slug
bashio::backup.location: Returns the location of a backup.$1: Backup slug
bashio::backup.homeassistant_version: Returns the version of Home Assistant that was in use when the backup was created.$1: Backup slug
bashio::backup.supervisor_version: Returns the version of Supervisor that was in use when the backup was created.$1: Backup slug
bashio::backup.addons: Returns the addons of a backup.$1: Backup slug
bashio::backup.repositories: Returns the repositories of a backup.$1: Backup slug
bashio::backup.folders: Returns the folders of a backup.$1: Backup slug
bashio::backup.homeassistant_exclude_database: Returns if the Home Assistant database file was excluded from this backup.$1: Backup slug
bashio::backup.compressed: Returns if the backup is compressed.$1: Backup slug
bashio::backup.homeassistant: Returns if the backup contains homeassistant.$1: Backup slug
bashio::backup.new_full: Creates a new full backup.$1: Backup json options, created by for examplebashio::var.json()
bashio::backup.new_partial: Creates a new partial backup.$1: Backup json options, created by for examplebashio::var.json()
bashio::backup.delete: Delete the backup.$1: Backup slug
bashio::backup.restore_full: Does a full restore of the backup.$1: Backup slug$2: Restore json options, created by for examplebashio::var.json()
bashio::backup.restore_partial: Does a partial restore of the backup.$1: Backup slug$2: Restore json options, created by for examplebashio::var.json()
App repositories in the store, from /store/repositories. Source: lib/repositories.sh.
bashio::repositories: Returns a JSON object with information about repositories.$1: Repository slug (optional) (default/empty/'false' for all repositories)$2: Cache key to store filtered results in (optional) (default/empty/'false' to cache only unfiltered results)$3: jq filter to apply on the result (optional) (default/empty is '.[].slug' with no slug or '.slug' with slug) ('false' for no filtering)
bashio::repository.name: Returns the name of a repository.$1: Repository slug
bashio::repository.source: Returns the source of a repository.$1: Repository slug
bashio::repository.url: Returns the URL of a repository.$1: Repository slug
bashio::repository.maintainer: Returns the maintainer of a repository.$1: Repository slug
bashio::repository.add: Add an addon repository to the store.$1: URL of the addon repository to add to the store.
bashio::repository.delete: Remove an unused addon repository from the store.$1: Repository slug
bashio::repository.repair: Repair/reset an addon repository in the store that is missing or showing incorrect information.$1: Repository slug
Network storage mounts, from /mounts. Source: lib/mounts.sh.
bashio::mounts: Returns a JSON object with information about the configured mounts.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::mounts.list: Returns a list of the names of all configured mounts.bashio::mounts.default_backup_mount: Returns the name of the default backup mount.bashio::mounts.create: Creates a new mount in the Supervisor.$1: Mount definition (JSON)
bashio::mounts.options: Sets the Mount Manager options.$1: Options object (JSON)
bashio::mount.reload: Reloads an existing mount in the Supervisor.$1: Mount name
bashio::mount.delete: Deletes an existing mount from the Supervisor.$1: Mount name
Docker settings and registries, from /docker. Source: lib/docker.sh.
bashio::docker: Returns a JSON object with generic information about the Docker configuration.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::docker.version: Returns the version of Docker in use.bashio::docker.storage: Returns the storage driver Docker is using.bashio::docker.logging: Returns the logging driver Docker is using.bashio::docker.enable_ipv6: Returns whether or not IPv6 is enabled for the Docker network.bashio::docker.mtu: Returns the MTU configured for the Docker network.bashio::docker.options: Sets Docker options.$1: Options object (JSON)
bashio::docker.registries: Returns a JSON object with the configured Docker registries.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::docker.registries.add: Adds a Docker registry.$1: Hostname of the registry$2: Username for the registry$3: Password for the registry
bashio::docker.registries.delete: Deletes a Docker registry.$1: Hostname of the registry
Security settings of the Supervisor, from /security. Source: lib/security.sh.
bashio::security: Returns a JSON object with generic Supervisor security information.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::security.options: Sets one or more security options on the Supervisor.$1: Options to set (JSON object)
bashio::security.pwned: Returns or sets whether or not pwned password checks are enabled.$1: True to enable pwned checks, false otherwise (optional).
bashio::security.force_security: Returns or sets whether or not security is forced.$1: True to force security, false otherwise (optional).