Home Assistant as the Integration Hub

TL;DR: My Home Assistant runs on a Raspberry Pi 5 at home, next to its own MQTT broker. Everything in the house that has an opinion, a Zigbee plug, a Raspberry Pi driving an aquarium light, a Google calendar, a Codeberg repository, ends up as an entity on one event bus inside Home Assistant, and nothing talks to anything else directly. The Kubernetes cluster gets a copy of the device traffic over a pull bridge and is allowed to fail. Three rules hold it together: local-first (whatever switches power works without the internet), fail-safe (every automation knows what to do when its input is missing), and one bus (integrations meet in Home Assistant, never behind its back). This post is the map. Where git had nothing, I read the live instance instead: how it is backed up, how it is updated, and the two things the house does depend on from outside, Home Assistant Cloud for remote access and voice, and the cluster for long-term history.
Why a hub, and why this one
I already wrote the cluster version of this post. From Git Push to Production Without a CI Vendor is the map of how code reaches production: one repo, one event source, every stage a resource you can inspect. The house needed the same treatment: it had grown into the same shape without a map.
It started with aquarium lights. It now includes a Pi that talks to the fertilizer dosing pumps, speakers that read me the publishing plan, a calendar written by a cron job in the cluster, and a custom integration that watches my Codeberg repositories. Each of those was added on a different evening for a different reason, and the only reason they do not fight each other is that all of them go through one place.
Three reasons Home Assistant is that place, before the architecture:
- It already spoke every protocol I had. Zigbee through zigbee2mqtt, MQTT with discovery, Google Cast, iCal, webhooks. Writing the glue myself would have meant writing a worse Home Assistant.
- It has a real event bus: every state change in Home Assistant is an event on an internal bus, and automations are subscribers. That is the property the rest of this post leans on.
- It runs at home. The cluster lives in a Hetzner data center. The things that switch power in my house should not need a data center to do it.
The aquarium is the vertical slice of this system, one tank traced through every layer with timestamps, and it has its own post: My Aquarium Runs on the Same Stack as My Cluster. I will not repeat the Zigbee and broker details here. This post is the horizontal view: what the hub is, and the rules for plugging anything new into it.
The map
flowchart LR
subgraph house["At home"]
zb["Zigbee plugs"] --> coord["USB coordinator"] --> z2m["zigbee2mqtt add-on"]
hs["HydroSense Pi<br/>(MQTT discovery)"]
z2m --> broker["local MQTT broker<br/>(EMQX add-on)"]
hs --> broker
subgraph ha["Home Assistant (Raspberry Pi 5)"]
mqtt["MQTT integration"] --> bus(("event bus"))
cal["Remote Calendar"] --> bus
fj["Forgejo integration"] --> bus
wh["webhook trigger"] --> bus
bus --> auto["automations, scripts"]
bus --> infl["InfluxDB integration"]
end
broker <--> mqtt
auto --> cast["Cast speakers"]
auto --> broker
end
subgraph cloud["Outside the house"]
gcal["Google Calendar<br/>(iCal feed)"] --> cal
cb["codeberg.org API"] --> fj
nc["Home Assistant Cloud<br/>remote UI, webhook, TTS, Google Assistant"] --> wh
end
subgraph k8s["Hetzner Kubernetes"]
vmq["VerneMQ, 3 nodes"] --> tg["Telegraf"] --> mqttb[("InfluxDB<br/>bucket mqtt")]
hab[("InfluxDB<br/>bucket homeassistant")]
end
broker -->|"pull bridge over the tailnet<br/>tcp 1883 only"| vmq
infl -->|"push: state history"| hab
The same picture as a table, which is the one I actually use when adding something:
| Integration | Direction | Transport | Works without the internet | Covered in |
|---|---|---|---|---|
| Zigbee plugs (lights, filters, heaters) | both | Zigbee, then MQTT | yes | aquarium post |
| HydroSense (aquarium Pi) | both | MQTT with discovery | yes | aquarium series |
| Cluster copy of device traffic | out | MQTT pull bridge, tailnet | the bridge does not; the house does | this post |
| Content calendar | in | Remote Calendar, iCal over HTTPS | no | H2 |
| Content status from the cluster | in | webhook through Home Assistant Cloud | no | H2 |
| Spoken reminders | out | Home Assistant Cloud TTS, Google Cast | no | H2 |
| Codeberg repositories | in | Forgejo custom integration, HTTPS polling | no | this post |
| State history | out | InfluxDB integration, pushes to the cluster’s homeassistant bucket | no: a dead cluster costs a gap in the history, not a switch | aquarium post, H3 |
| Remote access, voice | both | Home Assistant Cloud: remote UI, Google Assistant | no | H2 |
| My agents | both | ha-mcp custom component, the Home Assistant API | on the LAN yes; away from home it goes through the tailnet, which needs the internet | this post |
The first version of this table was everything git knew. The last three rows are what the instance’s own integration list added: the history push, the cloud subscription and the API my agents use were all set up by clicking and written down nowhere. The integration list has 50 entries, 47 of them loaded. Most are not integrations in the sense of this table: Home Assistant’s own plumbing, the helpers behind the energy counters, a printer, the sky data sources behind two notifications about clear nights and auroras, and Google Generative AI. Two more touch the aquarium and are not in the table, Tuya and Jebao Aquarium Pumps; rule 1 below says why.
Where it runs
Home Assistant runs on a Raspberry Pi 5 at home. The platform repo says so in three places, the VerneMQ docs, the observability docs and the bridge’s ExternalSecret, all of them because the cluster needs to know where to pull MQTT from. The rest comes from the instance itself, its system health page as I read it while writing this post:
| Field | Value |
|---|---|
| Installation | Home Assistant OS 18.5, board rpi5-64 |
| Core | 2026.11.1 |
| Supervisor | 2026.11.0 |
| Python | 3.14.10 |
| Disk | 28.1 GB, 11.5 GB used |
| Network | Wi-Fi is the only enabled adapter, plus the Tailscale add-on |
Storage is an SD card, for now. Power: there is no UPS, so a power cut takes the hub down with everything else.
Eight add-ons are installed. EMQX 0.10.1 is the local broker that the devices and the automations talk to. Zigbee2MQTT runs from the Edge add-on, the build that tracks zigbee2mqtt’s development branch rather than its releases. That is habit: the stable add-on once had no OTA updates for Tuya Zigbee devices, Edge did, and I never went back. Tailscale 0.30.7 puts the Pi on the tailnet. Grafana 13.1.0, Terminal & SSH 10.6.0, Advanced SSH & Web Terminal 24.2.1 and File editor 6.3.1 are the tools. The eighth is the ha-config reconciler 0.1.2, a local add-on that pulls the configuration repository and only observes (more on it under backups). There was a ninth until I removed it while working on this post: the Mosquitto broker 7.1.3 add-on, installed but stopped, with start on boot off. The repository’s runbook said to leave it that way. I uninstalled it after a fresh backup, because EMQX is the broker everything talks to and nothing used Mosquitto.
One add-on is missing from that list on purpose. There used to be an InfluxDB add-on on the Pi; the last trace of it is the backup the Supervisor took when it last updated it. Long-term history now lives in the cluster’s InfluxDB, written by Home Assistant’s InfluxDB integration, and the Pi keeps only a short local history: the recorder’s SQLite database is about 130 MiB and holds about ten days of state.
It is a dedicated machine on purpose. The cluster could run Home Assistant as a container: one more Helm chart, backups by Longhorn, updates by Renovate. I did not do it for the reason in the TL;DR. The cluster is in a data center, and a hub whose Zigbee radio is plugged into a USB port at home cannot live anywhere else without a network hop between the radio and the brain.
The weak spot is the one the table above makes plain: one board, and its only network link is Wi-Fi. The Zigbee radio does not care, it is on USB, but HydroSense, the speakers, the UI and the bridge to the cluster all reach the hub over the same wireless connection.
The network around it
The Pi joins my tailnet through the Tailscale add-on, and the tailnet policy is code, applied by Terraform, with tests that Tailscale runs on every save. Two rules in it are about Home Assistant, and they are the whole of what the outside world may do to the hub:
// Cluster nodes -> Home Assistant broker: the VerneMQ bridge (vernemq-0) pulls from it;
// pod traffic leaves the node with the node's tailnet address.
{"src": ["tag:k8s-node"], "dst": ["homeassistant"], "ip": ["tcp:1883"]},
// hydro-sense hosts -> Home Assistant MQTT broker, the only outbound access they have
{"src": ["tag:hydrosense"], "dst": ["homeassistant"], "ip": ["tcp:1883"]},
And the test that keeps it that way:
"src": "tag:k8s-node",
"accept": ["nas:2049", "homeassistant:1883", ...],
"deny": ["nas:22", ..., "homeassistant:22", ...],
The cluster gets port 1883 and nothing else: it can read the house’s MQTT traffic, but it cannot reach the Home Assistant UI, its API or SSH. A policy change that opened SSH from the nodes would be rejected by Tailscale before it applied, because the test would fail. That is the network version of a principle that comes back below: the cluster is downstream of the house, never in charge of it.
It is also why one integration goes the long way round. The content-calendar job in the cluster reports its status to a Home Assistant webhook, and because the nodes cannot reach the Home Assistant HTTP port over the tailnet, that webhook travels through Home Assistant Cloud. It is the one place the cluster pushes into the house, it carries status values only, and the automation listening to it writes helpers and can switch nothing. H2 is about that path.
Two buses, not one
People say “MQTT is the bus” and stop there. In this house there are two, and confusing them causes most of the design mistakes I made early on.
MQTT is the device bus. It carries what devices say and what they are told: zigbee2mqtt/Light 112L reporting watts, hydrosense/hs01/tank_54/state folding a tank into one message, a .../set topic switching something. It is a transport. It does not know what a light is, and it is shared with things outside Home Assistant: the cluster subscribes to it through the bridge.
The Home Assistant event bus is the integration bus. Inside Home Assistant, every change of every entity is a state_changed event, every service call is a call_service event, and an automation is a subscriber with a filter. An MQTT message only becomes part of it after the MQTT integration has turned it into an entity state. So does an iCal event, a webhook body, a Codeberg issue count. On this bus nobody can tell where a state came from, and that is the point.
Watching the device bus takes one box in the Home Assistant UI: Settings, Devices and services, MQTT, Configure, Listen to a topic. Subscribe to zigbee2mqtt/+ and every reading arrives as one JSON message on a topic named after the device. The card cuts each payload at its edge, which is why the lines end at linkquality:

Watching the integration bus is a different page. Developer tools, Events, listen to state_changed, and switch a plug by hand:

The capture is one plug, switch.light_54_l, switched off from an API call. The event carries the entity_id, an old_state of on and a new_state of off at 21:00 local time (20:00 UTC in the event), and a separate context id on each of the two states. The context of the old state even names a parent, the context of the previous change I had made to the same plug a few minutes earlier.
The context field is worth a closer look. It is the closest thing the house has to a trace ID: an automation run and the state changes it caused share one, so “who switched this off” has an answer.
Three rules for anything that plugs in
Each rule already shapes a file in git, and the files are the evidence.
1. Local-first: whatever switches power works without the internet
The automations that switch power talk to the local broker on the same Pi. If the Hetzner cluster, the tailnet or my internet connection disappears, the aquarium lights still switch at two in the afternoon. The cluster gets a copy of the device traffic and is allowed to fail; the aquarium post traces one of those automations end to end.
The rule is narrower than “local-first” sounds. Look at the table above: the calendar, the spoken reminders, the Codeberg integration and the cluster’s status webhook all need the internet. The rule I actually follow is that nothing that switches power depends on anything outside the house, while information can come from anywhere. When the internet drops, the speakers will not read out the plan of the day. The heaters do not care.
Read from the live instance, the rule holds for control: the broker is local, the Zigbee radio is local, and the automations that switch power talk to nothing else. It also has two dependencies pointing outward, and I would rather name them than discover them.
- Home Assistant Cloud. Remote access, the cluster’s webhook, the spoken reminders and Google Assistant all go through it, and Google Assistant is how the speakers’ plan of the day reaches Home Assistant at all. It is a subscription. When it lapses, all four go with it, and nothing in the house switches differently.
- The cluster. The InfluxDB integration pushes state history into it, and the Pi keeps only what its recorder holds, which is about ten days. When the cluster is down, the history gets a gap. The aquarium post covers that path in detail: the event bus is pulled, the history is pushed.
Neither can switch anything. Both are the house depending on the outside, which is why each has a row in the table.
I checked it against all 17 automations in the instance, not only the ones in git. Twelve of them switch something: the lights, the fish room switch, the two LED preset automations, the demo dosing and five that belong to the top-off pump, which are all switched off because there is no top-off yet. Each is triggered by a clock, a helper or an entity that arrives over MQTT, and none reads a cloud entity. The only cloud calls in that group are two steps of the biotope automation that would have the Google assistant comment on a preset change and speak it through Home Assistant Cloud, and both steps are disabled. The other five only inform: two sky notifications, the spoken reminder, the calendar refresh and the cluster’s webhook.
What that check does not cover is a device behind a cloud integration. The instance has two candidates. The Tuya integration holds two Wi-Fi plugs, a desk lamp socket and a power supply switch, and it talks to the Tuya cloud, so both depend on the internet and a Tuya account. No automation uses either. A local route would need each plug’s local key from a Tuya developer account, and I have left them on the cloud integration. The Jebao Aquarium Pumps integration lists the same two dosing pumps that HydroSense drives, and its manifest declares local_push, so it stays on the local network too. The dosing itself runs through HydroSense on the Raspberry Pi Zero, with no cloud, and no Home Assistant automation uses the integration.
2. Fail-safe: every automation knows what to do when its input is missing
A fail-safe in a house is the answer to “what happens when this input is missing, wrong or late”, written down before it happens.
The aquarium lights answer it with a reconcile loop: they re-assert the state the tank should be in every 15 minutes, so a missed trigger is corrected on the next pass. The smaller example is the script that speaks on the speakers, and it is worth reading because every guard in it is a failure I had already imagined:
say:
sequence:
- if: # quiet hours: nothing between 21:00 and 08:00 unless forced
- condition: template
value_template: "{{ not forced }}"
- condition: not
conditions:
- condition: time
after: "08:00:00"
before: "21:00:00"
then:
- stop: quiet hours
- if: # a speaker that is gone is not an error, it is a no-op
- condition: template
value_template: "{{ states(speaker) in ['unavailable', 'unknown'] }}"
then:
- stop: speaker unavailable
- action: scene.create # remember the speaker's volume, put it back afterwards
data:
scene_id: before_announcement
snapshot_entities: "{{ [speaker] }}"
# ... volume, tts.speak, wait, scene.turn_on
(Trimmed from calendar/home-assistant.yaml in my content-ops repo.) Above all of it sits one helper, input_boolean.publishing_announcements, which silences every message when it is off. The rule behind that switch is that an automation which talks to people needs an off switch a person can find without opening an editor.
The same rule applies across the network boundary. When the cluster’s job cannot reach Home Assistant, the job does not fail: an unreachable house never changes a run’s exit code. The cluster’s pipelines are not allowed to break because my Pi is rebooting, and my Pi is not allowed to break because the cluster is down.
3. One bus: integrations meet in Home Assistant, never behind its back
Every integration publishes into Home Assistant and takes orders from it. None of them talks to another one directly, and none of them shares ownership of a device.
HydroSense is the clearest case. It reads the power of the Zigbee plugs its lamps hang on, because it needs to know whether a lamp is powered, and it is explicitly forbidden to switch them. The comment in its Ansible inventory says it in one line: the plug “only REPORTS (power, unpowered lamp), hydro-sense never switches it - Home Assistant owns the lamps’ power”. Its docs add the consequence: “hydro-sense must not fight HA”, so entering service mode at night cannot light a tank whose plug Home Assistant has switched off.
That is the rule in one sentence: every actuator has exactly one owner, and the owner is Home Assistant. Two controllers writing the same switch is how you get a light that flickers between two opinions at 22:00, and I have seen enough of that pattern at work, in two operators reconciling one resource, to not want it in the house.
The webhook from the cluster follows the same rule from the other side. It can write status helpers and cannot call a service, so a compromised or confused cluster can lie to my dashboard but cannot turn anything on.
How it is backed up
Git records nothing about Home Assistant backups. The instance does. Settings, System, Backups, as it stood while I was writing this:
- Schedule. An automatic backup every day in the early morning; the last two daily ones started at 04:58 and 05:22.
- Contents. Full: the configuration, the recorder database, all eight add-ons and the ssl folder. Password-protected, and the password is kept in Bitwarden, not on the Pi.
- Where the copies go. The Pi’s own disk keeps the last three, 142 to 145 MB each as the Backups page shows it. The middle one is the backup I took by hand before uninstalling Mosquitto. It is made with the same settings, so it counts against the same limit of three, and the copies span a day and a half instead of three days. The newest one is also uploaded to Home Assistant Cloud, which keeps only the latest, so of the three only the newest has a cloud copy.
- Before add-on updates. The Supervisor backs up an add-on by itself before it updates it: Tailscale, Grafana, InfluxDB and EMQX each have one, and so do older updates.
- Before core updates and big changes. By hand. The manual full backups in the list are the one named after the 2026.10.3 update and the one named pre-ha-config, taken before the reconciler went on. The newest one by hand, taken before the Mosquitto removal, is named like an automatic backup.
That is more than I expected to find, and less than it sounds. Off the Pi there is exactly one copy, the latest, and it lives behind the same subscription as the remote UI. If a daily backup ever came out broken, the cloud would hold that one and nothing older. Nothing goes to the NAS. And a backup is only a backup once it has been restored, so the restore has been tested.
Some of it is copied elsewhere by accident of architecture. The long-term history lives in InfluxDB in the cluster, on a Longhorn volume that is in the cluster’s daily backup set, so losing the Pi does not lose the record of what the plugs did. The automations and scripts I care most about have their original in git: calendar/home-assistant.yaml is the source, and Home Assistant’s own automations.yaml holds the deployed copy. The aquarium automations are in a published post.
There is also a repository for the instance itself, ha-config. A reconciler add-on on the Pi pulls it and compares it with the running instance: areas, devices, which entities are exposed to voice assistants, labels and the grid price of the Energy dashboard. Helpers and dashboards are not in it; they live in the instance and in the daily backup. The reconciler only observes: the add-on’s own description says “This build only observes”, it publishes a status, a plan and a snapshot of the live registries to the broker, and nothing is applied. When I looked, the plan was one label to create and 48 devices and entities to add it to, nothing else, and no build of the add-on can write it yet, so I added the label by hand and the plan has been empty since. The cluster turns a difference that lasts 30 minutes into an alert.
Put together: daily copies on the same board they protect, one copy off-site, the history somewhere else entirely, and a restore that has been tested. Making that a strategy, with a regular restore drill, is what H3 is for.
How it is updated
Git records nothing about updates either, so again the instance. Home Assistant Core and the OS update by hand. The Supervisor and most add-ons update by themselves: EMQX, Zigbee2MQTT Edge, Tailscale, Grafana and both SSH add-ons. File editor, like everything that comes through HACS, waits for me. The reconciler is a local add-on, so it changes only when I copy a new build to the Pi and press Update; its auto-update flag has nothing to pull. That is how it ended up behind the registry it reads, which the limitations below describe. When I checked, Core was on 2026.11.1, the OS on 18.5 and the Supervisor on 2026.11.0, and nothing was pending. Four updates had been waiting the day before, the Forgejo integration, a Xiaomi integration and two dashboard cards, all from HACS, so all mine to press. I installed the Forgejo one myself after reading its release notes, and the others have been installed since. Tailscale 0.30.7 had been on that list a day earlier and installed itself in between. HACS has 31 installed repositories and feeds the same list.
The pattern the instance shows is one I never wrote down: Core and OS by hand, with a manual backup first, as before 2026.10.3; add-ons mostly automatic, with the Supervisor’s own backup in front of each one, which is why that list of per-add-on backups exists at all. The part I keep an eye on is the automatic one: EMQX sits in the path of every plug, and it updates without asking. Zigbee2MQTT Edge is the exception to the exception: its version is literally “edge”, so the auto-update flag has nothing to install, and the add-on’s own documentation says to update it by uninstalling and reinstalling. Before I press one by hand I read the release notes.
The other thing that shapes the policy is what an update can overwrite. The Forgejo integration I use carries two local patches: a 30 second timeout, because codeberg.org takes 10 to 13 seconds to answer the issue search and the client’s default is 10, and a fix that treats a 404 from the Actions API as “no runs” rather than “skip the repository”. The note next to them says an update from the Marketplace overwrites them and the integration breaks the same way again. Nothing would alert, because a broken integration in Home Assistant shows up as entities going unavailable, not as a page.
Both patches have since gone upstream. The pull request (HA-Forgejo #6) was merged and release v1.0.4 contains it. This instance ran v1.0.3 with my copies until I updated it. I took a full backup, updated to v1.0.4 through HACS, which replaced my patched files, and restarted Core. All 32 entities of the integration came back and none is unavailable. The 11 CI entities are unknown, as before, because CI runs in Argo. The two counts that used to time out loaded on the first refresh: 2 assigned issues and 0 review requests.
Limitations
- Backups and updates live in the instance, not in git. The two sections above were read from the live Home Assistant, not from a repo. The cluster can be rebuilt from one repo; the hub would be rebuilt from a backup, and restoring one has been tested.
- One off-site copy. Daily full backups stay on the Pi for three days, and only the latest one also goes to Home Assistant Cloud. There is no other copy outside the house.
- One board, on Wi-Fi. The Raspberry Pi is a single point of failure for everything that switches power, and its only network link is wireless. The first half is the price of local-first. There is no UPS, so even a power cut is enough. If the Pi dies, the lights stop switching, and the only thing that would notice is the cluster’s alert on the bridge, described at the end of this list: 30 minutes of silence, then five more before it pages. Nothing in the house watches the Pi.
- “Local-first” is only true for control. Remote access, voice, the calendar, the Codeberg integration and the long-term history all leave the house, and two of those, Home Assistant Cloud and the cluster, are dependencies rather than conveniences. I have chosen which ones may, but that is a judgment, and the table is the only place it is written down.
- The integration table is a judgment, not an export. Three rows came from the live integration list, and the list holds 50 entries. I left out the housekeeping ones, and Tuya and Jebao for the reason given under rule 1.
- The cluster watches the hub, the hub does not watch itself. The repository defines
HaGitopsBridgeSilent, which pages when nothing crosses the bridge for 30 minutes (a dead Pi, EMQX or Wi-Fi link), andHaGitopsReconcilerSilent, a deadman on the reconciler add-on. Neither tells me when Home Assistant is slow or out of disk. Both are live, as rules in the cluster’s vmalert rather than in Grafana. I have not seenHaGitopsBridgeSilentfire.HaGitopsReconcilerSilentfired once, in a drill: I stopped the add-on, the page reached Slack after 35 minutes (34 minutes 47 seconds, measured), and the resolve message came about four minutes after I started it again. Two other rules in the same object fired for real.HaGitopsDriftDetectedfired from the day the rules went in, because the plan wanted an ownership label on 26 devices and 22 entities that nobody had applied.HaGitopsReconcilerCriticalfired within a minute of the fault and then repeated in Slack for about two days, while I was looking at other things; I found it in the metrics, not in the channel. The reconciler add-on was older than the registry it reads, so it rejected the registry frommainand built no plan, which is also why the drift alert fell silent for a few days. Slack also got three RESOLVED messages while the fault was still there, because the series had a 12 minute hole and the rules resolved when it vanished. They now keep firing for 15 minutes. I rebuilt the add-on that evening, the next cycle built a plan again, and the critical alert cleared within two minutes. The drift alert cleared when I added the label by hand later that evening. Out of disk, at least, is covered since the day before this post went out: System Monitor now runs on the Pi, and four Grafana rules read the Pi’s sensors from InfluxDB. They fire when the last successful automatic backup is more than 36 hours old, the data disk is over 85 %, memory is over 90 %, or the SoC is over 80 °C, where the Pi 5 starts to throttle. Only the backup and disk rules reach Slack, and none has fired yet. - The alert chain has no outside watcher. The Watchdog alert, which exists to show that vmalert and Alertmanager are alive, goes to a null receiver, so if either of them stops, nothing says so. Monitoring the hub like a production service is H3.
Where the series goes next
This post is the map. The next ones each take one road on it:
- H2: Your Calendar Is an Event Source. The content calendar as an entity, the cluster job that writes it, the webhook that comes back, and the speakers that read it out.
- H3: Run Your House Like Production. Monitoring Home Assistant with the cluster’s own stack, backups with a restore drill, the rest of the configuration in git, and Home Assistant as an event source for n8n.
They land here as they are published. The aquarium series covers the device layer in depth, starting from My Aquarium Runs on the Same Stack as My Cluster.