Arsenal — a contract-driven architecture for Home Assistant
After years of watching Home Assistant configurations grow into something unmaintainable, I tried a different approach: treating HA as a governed software system instead of a collection of automations.
The result is Arsenal — my HA setup, now public after building a publication pipeline to make sure nothing sensitive leaked.
The problem I was trying to solve
If you've maintained a serious HA installation for a few years, you've probably hit some version of this:
- Automations triggering other automations, with no clear ownership of the logic
- Business rules spread across scripts, helpers, UI cards, and automations simultaneously
- Dashboards that do things instead of just rendering state
- Entities you're afraid to delete because you don't know what depends on them
- A
configuration.yamlthat grew organically and now no one fully understands
None of this is HA's fault. It's what happens when a powerful system is used without architectural constraints.
The core idea
Arsenal is built around three principles:
Backend decides. UI renders. Never the other way around.
No logic in dashboards. Cards display states they didn't calculate. Decisions happen upstream, in dedicated entities. The UI is a mirror, not an engine.
Contract before YAML.
Every functional domain has a written contract before any code. The contract defines entities, their roles, valid state transitions, and invariants the system must respect. YAML implements the contract — not the reverse.
Exposure is a decision, not an accident.
What's visible externally (API, MQTT, notifications) is explicitly governed. What's internal stays internal.
The architecture
┌─────────────────────────────────────────────┐
│ Physical sensors · Integrations · MQTT │ PERCEPTION
└───────────────────────┬─────────────────────┘
│ raw states
▼
┌─────────────────────────────────────────────┐
│ Template sensors · Helpers · Constraints │ DECISION
└───────────────────────┬─────────────────────┘
│ decision states
▼
┌─────────────────────────────────────────────┐
│ Automations · Sovereign scripts │ EXECUTION
└───────────────────────┬─────────────────────┘
│ commands
▼
Hardware
The UI doesn't appear in this diagram. It observes — it doesn't participate in the flow.
What this looks like concretely
Taking the VMC (ventilation) domain as an example:
sensor.vmc_besoin_brut— is there a ventilation need? (CO2, humidity)sensor.vmc_admissibilite— is the context allowing action? (time, presence, locks)input_text.vmc_decision— formal decision state:on_demande/off_demande/verrouilleautomation.vmc_application_decision— fires on decision state change, nothing elsescript.vmc_allumage— sovereign script with MQTT ACKsensor.vmc_coherence— detects divergence between decision and real state
The same pattern applies to every domain: alarm, domestic hot water circulation, dehumidifier, boiler.
What's in the repo
- Full HA configuration structured by architectural layer
- Formal contracts for each domain in
00_documentation_arsenal/ - Versioned changelogs documenting architectural decisions, not just changes
- Contract validation scripts that check entity consistency across YAML
- A publication audit pipeline (
scripts/security/) that enforces zero leaked credentials before any push
The publication pipeline was actually an interesting sub-project — it goes from naive regex to a proper risk classification system with CRITICAL / WARNING / [scope=doc] levels. That alone took several iterations to get right.
What this isn't
Not a setup to copy. The entities, MQTT topics, and device names are specific to one installation.
Not a framework or a library. Arsenal is a configuration with a strong point of view on how to organize one.
What might be useful: the patterns, the contracts structure, the separation of concerns approach, and the tooling.
GitHub: GitHub - antoinevalentinHA/arsenal: Home Assistant as a governed system · GitHub
Happy to discuss the architectural choices — particularly around the decision layer and the contract model, which are the parts that differ most from typical HA setups.