On this page

These functions wrap the apps endpoints and parts of the store endpoints 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.

Most functions take the slug of an app as their first argument. Leave it out, and the function works on your own app, self. Your own app is always allowed; for other apps, your app needs hassio_api: true and a fitting role, see what your app may call.

Shell
#!/command/with-contenv bashio

bashio::log.info "Starting $(bashio::app.name) $(bashio::app.version)"

if bashio::var.true "$(bashio::app.update_available)"; then
  bashio::log.notice "Version $(bashio::app.version_latest) is out"
fi

port=$(bashio::app.ingress_port)

Deprecated names

Bashio used to call these functions bashio::addon.*, bashio::addons, and bashio::addons.*. Every bashio::app.*, bashio::apps, and bashio::apps.* function still has an alias with the old name. The alias calls the new function and logs a warning the first time you use it. The aliases may be removed in a future release, so use the new names.

App functions

Read and change apps, their options, their state, and their resource usage. The bashio::require.* functions stop the script when protection mode is not what your app needs. Source: lib/apps.sh.

  • bashio::apps.reload: Reloads the apps.
  • bashio::app.start: Start the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.restart: Restart the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.stop: Stop the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.install: Install the specified app.
    • $1: App slug
  • bashio::app.rebuild: Rebuild the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.uninstall: Uninstall the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.update: Update the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.logs: RAW Docker logs of the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.documentation: Returns the documentation of the app.
    • $1: App slug (optional, default: self)
  • bashio::app.changelog: Returns the changelog of the app.
    • $1: App slug (optional, default: self)
  • bashio::apps: Returns a JSON object with information about addons.
    • $1: App slug (optional) (default/empty/'false' for all apps)
    • $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 '.addons[].slug' with no slug or '.slug' with slug) ('false' for no filtering)
  • bashio::apps.installed: Returns a list of installed apps or for a specific apps.
    • $1: App slug (optional)
  • bashio::app.installed: Returns whether or not this app is installed.
    • $1: App slug (optional, default: self)
  • bashio::app.slug: Returns the slug of the current (self) app.
  • bashio::app.name: Returns the name of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.hostname: Returns the hostname of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.dns: Returns a list of DNS names for the app.
    • $1: App slug (optional, default: self)
  • bashio::app.description: Returns the description of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.long_description: Returns the long description of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.auto_update: Returns or sets whether or not auto update is enabled for this app.
    • $1: App slug (optional, default: self)
    • $2: Set current auto update state (optional)
  • bashio::app.url: Returns the URL of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.detached: Returns the detached state of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.available: Returns the availability state of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.advanced: Returns if this is an advanced app.
    • $1: App slug (optional, default: self)
  • bashio::app.stage: Returns the stage the app is currently in.
    • $1: App slug (optional, default: self)
  • bashio::app.startup: Returns the phase the app is started up in.
    • $1: App slug (optional, default: self)
  • bashio::app.arch: Returns a list of supported architectures by the app.
    • $1: App slug (optional, default: self)
  • bashio::app.machine: Returns a list of supported machine types by the app.
    • $1: App slug (optional, default: self)
  • bashio::app.repository: Returns the slug of the repository this app is in.
    • $1: App slug (optional, default: self)
  • bashio::app.version: Returns the version of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.version_latest: Returns the latest version of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.update_available: Checks if there is an update available for an app.
    • $1: App slug (optional, default: self)
  • bashio::app.state: Returns the current state of an app.
    • $1: App slug (optional, default: self)
  • bashio::app.boot: Returns or sets the current boot setting of this app.
    • $1: App slug (optional, default: self)
    • $2: Sets boot setting (optional).
  • bashio::app.build: Returns whether or not this app is being build locally.
    • $1: App slug (optional, default: self)
  • bashio::app.options: Returns or sets options for this app.
    • $1: App slug (optional, default: self)
    • $2: The app configuration (optional)
  • bashio::app.option: Edit options for this app.
    • $1: Config Key to set or remove (required)
    • $2: Value to set (optional, default:null, if null will remove the key pair)
    • $3: App slug (optional, default: self)
  • bashio::app.config: Returns a JSON object with app specific config for the addon itself. This can be only used by self.
  • bashio::app.network: Returns or sets a list of ports which are exposed on the host network for this app.
    • $1: App slug (optional, default: self)
    • $2: A map of network configuration (optional)
  • bashio::app.network_description: Returns a list of ports and their descriptions for this app.
    • $1: App slug (optional, default: self)
  • bashio::app.port: Returns or sets a user configured port number for an original port number.
    • $1: Original port number
    • $2: App slug (optional, default: self)
    • $3: User configured port number (optional)
  • bashio::app.port_description: Returns a description for port number for this app.
    • $1: Original port number
    • $2: App slug (optional, default: self)
  • bashio::app.host_network: Returns whether or not this app runs on the host network.
    • $1: App slug (optional, default: self)
  • bashio::app.host_pid: Returns whether or not this app runs on the host pid namespace.
    • $1: App slug (optional, default: self)
  • bashio::app.host_ipc: Returns whether or not this app has IPC access.
    • $1: App slug (optional, default: self)
  • bashio::app.host_dbus: Returns whether or not this app has DBus access to the host.
    • $1: App slug (optional, default: self)
  • bashio::app.privileged: Returns the privileges the app has on the hardware / system.
    • $1: App slug (optional, default: self)
  • bashio::app.apparmor: Returns the current apparmor state of this app.
    • $1: App slug (optional, default: self)
  • bashio::app.devices: Returns a list of devices made available to the app.
    • $1: App slug (optional, default: self)
  • bashio::app.udev: Returns if the app provides its own udev support.
    • $1: App slug (optional, default: self)
  • bashio::app.uart: Returns if UART was made available to the app.
    • $1: App slug (optional, default: self)
  • bashio::app.usb: Returns if USB was made available to the app.
    • $1: App slug (optional, default: self)
  • bashio::app.icon: Returns whether or not this app has an icon available.
    • $1: App slug (optional, default: self)
  • bashio::app.logo: Returns whether or not this app has a logo available.
    • $1: App slug (optional, default: self)
  • bashio::app.has_documentation: Returns whether or not this app has documentation available.
    • $1: App slug (optional, default: self)
  • bashio::app.has_changelog: Returns whether or not this app has a changelog available.
    • $1: App slug (optional, default: self)
  • bashio::app.hassio_api: Returns whether or not this app can access the Supervisor API.
    • $1: App slug (optional, default: self)
  • bashio::app.hassio_role: Returns the Supervisor API role of this app.
    • $1: App slug (optional, default: self)
  • bashio::app.homeassistant: Returns the minimal required Home Assistant version needed by this app.
    • $1: App slug (optional, default: self)
  • bashio::app.homeassistant_api: Returns whether or not this app can access the Home Assistant API.
    • $1: App slug (optional, default: self)
  • bashio::app.auth_api: Returns whether or not this app can access the Supervisor Auth API.
    • $1: App slug (optional, default: self)
  • bashio::app.protected: Returns whether or not this app runs in protected mode.
    • $1: App slug (optional, default: self)
  • bashio::app.rating: Returns the app its rating
    • $1: App slug (optional, default: self)
  • bashio::app.stdin: Returns whether or not this app can use the STDIN on the Supervisor API.
    • $1: App slug (optional, default: self)
  • bashio::app.full_access: Returns whether or not this app has full access
    • $1: App slug (optional, default: self)
  • bashio::app.webui: A URL for web interface of this app.
    • $1: App slug (optional, default: self)
  • bashio::app.gpio: Returns whether or not this app can access GPIO.
    • $1: App slug (optional, default: self)
  • bashio::app.kernel_modules: Returns whether or not this app can access kernel modules.
    • $1: App slug (optional, default: self)
  • bashio::app.devicetree: Returns whether or not this app can access the devicetree.
    • $1: App slug (optional, default: self)
  • bashio::app.docker_api: Returns whether or not this app can access the Docker socket.
    • $1: App slug (optional, default: self)
  • bashio::app.video: Returns whether or not this app can access video devices.
    • $1: App slug (optional, default: self)
  • bashio::app.audio: Returns whether or not this app can access an audio device.
    • $1: App slug (optional, default: self)
  • bashio::app.audio_input: Returns or sets the available audio input device for an app.
    • $1: App slug (optional, default: self)
    • $2: Audio input device to set (optional)
  • bashio::app.audio_output: Returns or sets the available audio output device for an app.
    • $1: App slug (optional, default: self)
    • $2: Audio output device to set (optional)
  • bashio::app.ip_address: Returns IP address assigned on the home assistant network for an app.
    • $1: App slug (optional, default: self)
  • bashio::app.ingress: Returns if the app supports ingress mode.
    • $1: App slug (optional, default: self)
  • bashio::app.ingress_entry: Returns the ingress entry point of the app.
    • $1: App slug (optional, default: self)
  • bashio::app.ingress_url: Returns the ingress url of the app.
    • $1: App slug (optional, default: self)
  • bashio::app.ingress_port: Returns the ingress port of the app.
    • $1: App slug (optional, default: self)
  • bashio::app.ingress_panel: Returns or sets whether or not ingress_panel is enabled for this app.
    • $1: App slug (optional, default: self)
    • $2: Set current ingress_panel state (optional)
  • bashio::app.watchdog: Returns or sets whether or not watchdog is enabled for this app.
    • $1: App slug (optional, default: self)
    • $2: Set current watchdog state (optional)
  • bashio::app.stats: List all available stats about an app.
    • $1: App slug (optional, default: self)
    • $2: Cache key to store results in (optional)
    • $3: jq Filter to apply on the result (optional)
  • bashio::app.cpu_percent: Returns CPU usage from the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.memory_usage: Returns memory usage from the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.memory_limit: Returns memory limit from the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.memory_percent: Returns memory usage in percentage for the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.network_tx: Returns outgoing network usage from the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.network_rx: Returns incoming network usage from the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.blk_read: Returns disk read usage from the specified app.
    • $1: App slug (optional, default: self)
  • bashio::app.blk_write: Returns disk write usage from the specified app.
    • $1: App slug (optional, default: self)
  • bashio::require.protected: Checks if the app is running in protected mode and exits if not.
  • bashio::require.unprotected: Checks if the app is running in unprotected mode and exits if not.
Was this page helpful?

Last updated on .