Home Assistant integration

The D2HA integration brings your containers to Home Assistant: an update entity and a state sensor for each container, counters and maintenance buttons, and a dashboard that builds itself.

Requirements

  • Home Assistant 2026.8 or later.
  • D2HA reachable from Home Assistant (see the address).
  • An API token, from D2HA Settings → Home Assistant.

Install the integration

D2HA is in the catalogue of Home Assistant's Marketplace (the HACS default list), so a search finds it. This link opens it in your Home Assistant, in the Marketplace or in HACS. By hand:

Home AssistantHow
2026.11 or laterSettings → Marketplace, search for D2HA, then Install and Restart Home Assistant.
2026.8 to 2026.10Open HACS, search for D2HA, download it and restart Home Assistant.
If the search does not find it

Add https://github.com/arborae/ha-d2ha yourself with type Integration: Add from link in the Marketplace (the first time, it asks you to connect GitHub), or as a custom repository in HACS.

Connect it to D2HA

  1. In D2HA, open Settings → Home Assistant, press Create token and copy it.
  2. In Home Assistant, open Settings → Devices & services → Add integration → D2HA.
  3. Enter the address of D2HA and the token.

The address

It is the address of D2HA as Home Assistant sees it:

Home Assistant runsAddress
On the same host, with network_mode: host (the usual setup)http://127.0.0.1:12021
In a container on the same Docker network as D2HAhttp://d2ha:12021 (the container name)
On another machineThe HTTPS address of your reverse proxy or tunnel
Note

The example compose publishes D2HA on 127.0.0.1 only. Do not open the port to the network without HTTPS in front: see Security.

What you get

A device called D2HA for the server, and under it one device per container, named after the container.

EntityDeviceWhat it does
UpdateEach containerInstalled and latest version, release notes of the exact new version, progress during an update, and Install when D2HA can update it. Attributes: image, stack, update_status, breaking_changes, can_update.
StateEach containerrunning, exited, paused… Attributes: image, stack, status, health, update_status.
Updates availableD2HAHow many containers have an update; the containers attribute lists their names.
Containers runningD2HAHow many run; the containers attribute is the total.
Unused imagesD2HAImages that Clean images would delete.
Check for updatesD2HAStarts a check now.
Update allD2HAUpdates every container with an update, one at a time. Not there in read-only mode.
Clean imagesD2HADeletes the unused images. Not there in read-only mode.

The containers also appear in Settings → Updates, with the image name, the release notes and Install. Updates started from the D2HA web interface show their progress there too. Give the container devices an area (the device page, pencil icon) and that list is grouped by it.

Counters

Updates available counts every container of D2HA, while Home Assistant only has entities for the containers you show it.

Choose the containers

Every container appears in Home Assistant unless you hide it in D2HA, Settings → Home Assistant → Containers shown in Home Assistant. New containers appear on their own. D2HA itself never does.

When you hide or remove a container, its entities become unavailable. To delete its device, open it in Home Assistant and choose Delete: Home Assistant allows it once D2HA no longer lists the container.

How often it updates

The integration asks D2HA every 60 seconds, and every 5 seconds while an update runs. D2HA itself looks for new versions every few hours: the Check for updates button does it now.

An automation

A message on your phone when updates appear:

triggers:
  - trigger: numeric_state
    entity_id: sensor.d2ha_updates_available
    above: 0
actions:
  - action: notify.notify
    data:
      title: Container updates
      message: >-
        {{ state_attr('sensor.d2ha_updates_available', 'containers') | join(', ') }}

The entity id depends on the language of your Home Assistant: find yours in Settings → Devices & services → D2HA.

Automations has more examples, ready to paste: updates at night, a message when a container stops, a weekly cleaning of the images.

A new token

If you press New token or Revoke in D2HA, Home Assistant shows Renew the D2HA token in Settings: paste a new token there.

Change the address

New host, a reverse proxy, a different port: Settings → Devices & services → D2HA → ⋮ → Reconfigure changes the address (and the token, if you give a new one) without deleting the integration: areas and entity settings survive.

Diagnostics

Settings → Devices & services → D2HA → ⋮ → Download diagnostics downloads a JSON file for bug reports: the configuration with the address and the token blacked out, the counters and what D2HA last answered, per container. Attach it when you open an issue.

D2HA inside a dashboard

To open the D2HA web interface inside Home Assistant (a Webpage card or panel), allow the address of Home Assistant in D2HA:

D2HA_FRAME_ANCESTORS: "https://homeassistant.example.com"
Same site

Use addresses on the same site, such as homeassistant.example.com and d2ha.example.com: browsers do not send the D2HA sign-in to a page embedded in another site.

Something wrong or missing on this page? Open an issue.