Bashio: Core, host, and OS
Bashio functions that wrap the Supervisor API for Home Assistant Core, the host, Home Assistant OS, hardware, and the network.
These functions wrap the Home Assistant Core endpoints and the host and OS 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 of them need hassio_api: true, and the calls that change something need a role that allows it, see what your app may call. To read hardware for your own app, like serial ports, you do not need these functions: map the device in config.yaml, see Access hardware and the host.
Control Home Assistant Core and read its settings and resource usage, from /core. Source: lib/core.sh.
bashio::core.start: Starts Home Assistant.bashio::core.stop: Stops Home Assistant.bashio::core.restart: Restarts Home Assistant.bashio::core.rebuild: Rebuild Home Assistant.bashio::core.update: Updates Home Assistant to the latest version.$1: Version to update to (optional)
bashio::core.check: Checks/validates your Home Assistant configuration.bashio::core.logs: Returns the logs created by Home Assistant.bashio::core: Returns a JSON object with generic Home Assistant information.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::core.version: Returns the version of Home Assistant.bashio::core.version_latest: Returns the latest version of Home Assistant.bashio::core.update_available: Checks if there is an update available for Home Assistant.bashio::core.arch: Returns the arch of Home Assistant.bashio::core.machine: Returns the machine info running Home Assistant.bashio::core.image: Returns the Docker image of Home Assistant.$1: Image to set (optional).
bashio::core.custom: Returns whether or not a custom version of Home Assistant is installed.bashio::core.boot: Returns whether or not Home Assistant starts at device boot.bashio::core.port: Returns the port number on which Home Assistant is running.bashio::core.ssl: Returns whether or not Home Assistant is running on SSL.bashio::core.watchdog: Returns or sets whether or not Home Assistant is monitored by Watchdog.$1: True to enable watchdog, false otherwise (optional).
bashio::core.stats: List all available stats about Home Assistant.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::core.cpu_percent: Returns CPU usage from Home Assistant.bashio::core.memory_usage: Returns memory usage from Home Assistant.bashio::core.memory_limit: Returns memory limit from Home Assistant.bashio::core.memory_percent: Returns memory usage in percent from Home Assistant.bashio::core.network_tx: Returns outgoing network usage from Home Assistant.bashio::core.network_rx: Returns incoming network usage from Home Assistant.bashio::core.blk_read: Returns disk read usage from Home Assistant.bashio::core.blk_write: Returns disk write usage from Home Assistant.
The host system: hostname, features, disk usage, services, logs, reboot, and shutdown, from /host. Source: lib/host.sh.
bashio::host.reload: Reload the host controller.bashio::host.shutdown: Shuts down the host system.bashio::host.reboot: Reboots the host system.bashio::host.logs: Returns the logs created by the host system.bashio::host: Returns a JSON object with generic Host information.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::host.services: Returns a JSON object with the systemd services available on the host.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::host.disk_usage: Returns a JSON object with a breakdown of disk usage on the host system.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::host.hostname: Returns or sets the hostname of the host system.$1: Hostname to set (optional).
bashio::host.features: Returns a list of exposed features by the host.bashio::host.operating_system: Returns the OS of the host system.bashio::host.kernel: Returns the kernel of the host system.bashio::host.chassis: Returns the chassis of the host system.bashio::host.deployment: Returns the stability channel / deployment of the system.bashio::host.cpe: Returns the cpe from the host.bashio::host.disk_free: Returns the available diskspace on the host.bashio::host.disk_total: Returns the total diskspace on the host.bashio::host.disk_used: Returns the used diskspace on the host.
Home Assistant OS: version, updates, boot slots, data disk, swap, and board settings, from /os. Source: lib/os.sh.
bashio::os.update: Updates HassOS to the latest version.$1: Version to update to (optional)
bashio::os.config_sync: Load HassOS host configuration from USB stick.bashio::os: Returns a JSON object with generic Home Assistant Operating System (HassOS) information.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::os.version: Returns the version of HassOS.bashio::os.version_latest: Returns the latest version of HassOS.bashio::os.update_available: Checks if there is an update available for the OS.bashio::os.board: Returns the board running HassOS.bashio::os.boot: Returns the active boot.bashio::os.swap: Returns a JSON object with the swap settings (HassOS 15.0 or newer).$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::os.swap.options: Sets the swap settings (HassOS 15.0 or newer).$1: Options object (JSON), with swap_size and/or swappiness
bashio::os.datadisk.list: Returns a JSON object with the data disk targets available for migration.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::os.datadisk.move: Moves the data partition to another disk and reboots.$1: Target device id
bashio::os.datadisk.wipe: Wipes the data disk and reboots into a factory-reset state.bashio::os.boot_slot: Changes the active boot slot and reboots into it.$1: Boot slot ('A' or 'B')
bashio::os.boards.green: Returns a JSON object with the LED settings of a Home Assistant Green board.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::os.boards.green.options: Sets the LED settings of a Home Assistant Green board.$1: Options object (JSON), with activity_led, power_led and/or system_health_led
bashio::os.boards.yellow: Returns a JSON object with the LED settings of a Home Assistant Yellow board.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::os.boards.yellow.options: Sets the LED settings of a Home Assistant Yellow board.$1: Options object (JSON), with disk_led, heartbeat_led and/or power_led
Hardware the Supervisor knows about, from /hardware. Source: lib/hardware.sh.
bashio::hardware: Returns a JSON object with hardware information about the system.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::hardware.audio: Returns a JSON object with the audio devices (PulseAudio) known to the system.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::hardware.serial: Returns a list of available serial devices on the host system.bashio::hardware.input: Returns a list of available input devices on the host system.bashio::hardware.disk: Returns a list of available disk devices on the host system.bashio::hardware.gpio: Returns a list of available GPIO on the host system.bashio::hardware.usb: Returns a list of available USB devices on the host system.
Network interfaces and their settings, from /network. Source: lib/network.sh.
bashio::network.reload: Reload the network controller.bashio::network: Returns a JSON object with host network information.$1: Cache key to store results in (optional)$2: jq Filter to apply on the result (optional)
bashio::network.host_internet: Returns if the Host has internet connectivity.bashio::network.supervisor_internet: Returns if the Supervisor has internet connectivity.bashio::network.interfaces: Returns a list of all network interfaces.bashio::network.interface: Returns a JSON object with host network interface information.$1: Cache key to store results in (optional)$2: Network interface name (optional)$3: jq Filter to apply on the result (optional)
bashio::network.name: Returns the name of the network interface.$1: Interface name for this operation (optional)
bashio::network.type: Returns the type of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.enabled: Returns or sets if the interface is enabled.$1: Interface name for this operation (optional)$2: Set enabled state (optional)
bashio::network.connected: Returns if the interface is connected.$1: Interface name for this operation (optional)
bashio::network.ipv4_method: Returns the ipv4 method of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.ipv6_method: Returns the ipv6 method of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.ipv4_address: Returns a list of the ipv4 address of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.ipv6_address: Returns a list of the ipv6 address of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.ipv4_nameservers: Returns a list of ipv4 nameservers of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.ipv6_nameservers: Returns a list of ipv6 nameservers of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.ipv4_gateway: Returns the ipv4 gateway of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.ipv6_gateway: Returns the ipv6 gateway of the network interfaces.$1: Interface name for this operation (optional)
bashio::network.ipv4: Returns or sets the ipv4 json settings of the network interfaces.$1: Interface name for this operation (optional)$2: Ipv4 interface settings (optional)
bashio::network.ipv6: Returns or sets the ipv6 json settings of the network interfaces.$1: Interface name for this operation (optional)$2: Ipv6 interface settings (optional)