Architecture and contributor guide
The project focuses on two Python device libraries and two hand-maintained custom integrations. Make protocol changes in the library for the device, and Home Assistant behavior changes in its integration repository.
Libraries own the device interface
- python-mygrid-modbus provides
the ModuleTwo interface over Modbus TCP and is published on PyPI as
mygrid-modbus. - python-mygrid-voltbridge
provides the VoltBridge interface over HTTP and UDP and is published on PyPI as
mygrid-voltbridge.
These libraries own device communication and protocol decoding. The
python-mygrid-* names are repository names only; use the mygrid-* package
names when declaring dependencies.
Custom integration repositories own the HA guides and behavior
- ha-mygrid-modbus owns the ModuleTwo
integration, domain
mygrid_modbus. - ha-mygrid-voltbridge owns the
VoltBridge integration, domain
mygrid_voltbridge.
Both repositories are hand-maintained and are the source of truth for their
integration code and tests. They import their library from PyPI. The library
version pin lives in both the integration’s manifest.json and the dev
dependency group in pyproject.toml; scripts/validate_metadata.py fails if
those pins differ.
Marketplace and HACS allow one integration (one domain) per repository, so each device has its
own HACS repository. The naming convention is ha-mygrid-<library>, such as
ha-mygrid-modbus for mygrid-modbus.
Dormant Home Assistant core overlay
ha-mygrid-core is a dormant
overlay using the mygrid domain, retained for a possible Home Assistant core
contribution. It is not the source of the HACS repositories. Do not run
scripts/sync_hacs.py against the HACS repositories.
A future core PR would be ported from the HACS integrations once the ModuleTwo is validated on hardware. A core contribution is not guaranteed. Existing HACS entries would not migrate to a core entry because the domains differ.
Release flow
- Tag the library release as
vX.Y.Zin its repository. - Approve the publish workflow in the
pypienvironment. Publishing uses PyPI trusted publishing. - In the corresponding HACS repository, bump the library pin in both
manifest.jsonand thedevdependency group ofpyproject.toml, then runuv lockto update the lockfile. - Run metadata validation and the repository’s checks, then release the HACS
integration. Both HACS repositories build versioned manual-install ZIPs;
release tags must exactly match the integration manifest version (for example,
0.1.0). Custom-repository installation does not imply Marketplace catalog listing. Follow each repository’s release instructions: ModuleTwo and VoltBridge.
Contributor tooling
The repositories use uv for dependency and environment management,
hatch-vcs for versioning, Ruff with ALL rules, and mypy in strict mode.
Integration tests use pytest-homeassistant-custom-component.
Live tests are selected with -m live; provide VOLTBRIDGE_HOST for VoltBridge
or MYGRID_HOST for ModuleTwo. Follow the target repository’s test instructions
and hardware requirements before running them. ModuleTwo read-only library tests and partial integration acceptance passed on
2026-11-09; see the setup guide and its linked acceptance record
for remaining checks.
Website tooling
This hub uses Astro with static output on GitHub Pages. See website development and publishing for the project structure, Markdown routing, repository prefix, local commands and CI conventions that other projects can reuse.
Why older commits look different
Until 2026-10-24, the HACS repositories were generated from ha-mygrid-core,
with the libraries vendored byte for byte. That model was replaced to focus on
the libraries and custom HACS integrations. The transition was prepared on
own-the-source in both HACS repositories and park-core in the core
repository, and all three branches were merged on 2026-10-24. The HACS
repositories are now hand-maintained, and ha-mygrid-core is the dormant
overlay described above. Historical generator and vendoring references describe
the earlier model.
See the documentation index for device setup and protocol guides.
Documentation ownership
The hub renders authoritative integration and library Markdown from pinned upstream snapshots. HA setup, configuration, entities and automation examples belong in their integration repository; Python usage, protocol references and library validation belong in their library repository. This repository owns cross-device introductions, navigation and architecture. Edit each topic in its owning repository rather than maintaining a second guide here.
See upstream documentation publishing for the source manifest, update PR workflow and link handling.