# Home Assistant integration

> Show server health, updates, vulnerabilities, backups, certificates and per-subscription usage as Home Assistant sensors, with a read-only key and a pinned certificate.

Source: https://www.berthpanel.app/library/home-assistant/ · Category: automation · Updated: 2026-10-30

The Berth integration for Home Assistant turns the state of your server into ordinary Home Assistant sensors: CPU and memory, disks, failed services, pending updates, vulnerabilities, the last backup, unreachable sites and expiring certificates. You can put them on a dashboard, get a phone notification when a backup fails, or blink a lamp when a site goes down. The integration only reads; nothing in Home Assistant can change the panel.

## What you get

What appears depends on who creates the link: an administrator sees the server, a customer or reseller only their own subscriptions.

**Server** (administrators and auditors):

- CPU, load, memory and swap, network in and out, last boot;
- per disk: usage, free space and inodes;
- running and failed services;
- pending updates, security updates, and whether a reboot is needed;
- vulnerabilities by severity, including how many are fixable and how many are actively exploited;
- the problems found by the last diagnosis.

**For every account**: the last backup, unreachable sites and the next certificate to expire.

**Alarms** (binary sensors): update needed, reboot needed, service failed, backup failed, disk almost full, critical vulnerability, site unreachable, certificate expiring.

**Per subscription**, optionally: disk space (also against the package limit), traffic this month, last backup and certificate, as one device per subscription. Customers and resellers always get their own subscriptions; for an administrator this is a choice when creating the link.

New disks and subscriptions show up by themselves; one that disappears becomes unavailable.

## Requirements

- Home Assistant 2025.1 or newer. The integration needs no extra Python packages and is available in English and Dutch.
- The panel must have its own hostname with a certificate (see [Certificates](https://www.berthpanel.app/library/certificates/)), because the integration only connects over https.
- The link is made by the account owner. Restricted logins cannot create one.

## Setting it up

1. In Berth: *Settings → Integrations → Home Assistant* (for resellers and customers: *Integrations → Home Assistant*) → **Create link**. Choose how often Home Assistant refreshes (from seconds up to an hour; one minute by default), optionally the addresses it may connect from (your router's public address or a range), and, as an administrator, whether subscriptions are included.
2. **Download** gives a zip with the integration and a file `berth_connection.json` that holds the panel address, a new key, the pinned certificate fingerprint and the interval. The same details are shown once as a **pairing code** starting with `BERTH1-`.
3. Unpack the zip in the Home Assistant configuration directory (the one with `configuration.yaml`), so that `custom_components/berth/` exists, and restart Home Assistant.
4. In Home Assistant: *Settings → Devices & services → Add integration → Berth*. The integration finds the connection file, shows which panel and account it will link, tests the connection and then deletes the file, because it contains the key.

Without access to the configuration directory (for example on Home Assistant OS without a file add-on), install the integration files another way and paste the pairing code when adding the integration. You can also enter the address, key and fingerprint by hand.

The refresh interval can be changed later in the integration's options. Linking the same account on the same panel again updates the existing entry instead of creating a second one.

On the server the same is available as:

```bash
berth homeassistant zip --ip 203.0.113.7 -o berth-ha.zip
berth homeassistant zip --code             # print the pairing code instead
berth homeassistant keys                   # keys with last seen and requests per hour
berth homeassistant revoke --id 4
berth homeassistant state                  # the JSON Home Assistant receives
```

> [!NOTE]
> A listing in HACS, so that updates arrive through Home Assistant, is planned. Until then, install from the zip; it contains the integration version that comes with your Berth version.

## Security

**A read-only key for one purpose.** The key has the scope `monitor:read` and works on exactly one endpoint, the status the integration reads. Every other API path, including other reads, is refused. It cannot create keys or change anything. Requests per key are rate-limited; above the limit Home Assistant keeps its last values. Optionally the key only works from the addresses you chose.

**A pinned certificate.** The integration pins the SHA-256 fingerprint of the panel's certificate. When the panel renews its certificate, the integration accepts the new one only if a trusted certificate authority issued it for the panel's hostname, and then pins that one. A self-signed certificate that changes requires a new link. Turning certificate verification off is not possible, and the integration does not follow redirects, so the key never travels to another address.

**No key lying around.** The panel does not store the key after creating it; the download is available briefly and only to the person who made it. After pairing, the key is only in Home Assistant's configuration. Logs and diagnostics show at most `berth_` and the last four characters.

**Visible and revocable.** The panel page lists each key with when and from which address it was last used, the integration version and the number of requests per hour. Revoking works immediately: Home Assistant gets a refusal and asks for a new link.

## Licence

The integration is open source under the MIT licence.

## Related

- [Statistics and metrics](https://www.berthpanel.app/library/statistics-and-metrics/): Prometheus metrics for Grafana and similar tools.
- [Notifications and alerts](https://www.berthpanel.app/library/notifications-and-alerts/): alerts by mail, chat, push or SMS.
- [REST API](https://www.berthpanel.app/library/rest-api/#api-tokens-and-scopes): the `monitor:read` scope among the other token scopes.
