hems
An engine for OUTUS, the Open Utility Tariff & Usage Specification. It reads OUTUS plans and price series, keeps the usage ledger, and writes OUTUS bills with every line explained.
- Implements: OUTUS v1 (electricity). The spec is published separately; hems is one implementation of it.
- Python ≥ 3.11, no I/O. One dependency,
tzdata, so time zones work on any image. Callers supply readings, prices and the plan, and store the results. I/O adapters (such as Open-Meteo) are separate modules underhems.adapters. - Used by: the FranklinWH Direct Connect and Modbus bridges.
| Module | Job |
|---|---|
hems.ledger |
grid readings from the devices behind a meter → 5-minute usage intervals |
hems.prices |
a price series: price at an interval's start, later kinds replace earlier ones |
hems.billing |
an OUTUS bill from a plan and the ledger, with formulas; provisional bills project to the period's end; now_rates for the live band and rate |
hems.periods |
billing period bounds (monthly, bimonthly, quarterly) |
hems.plans |
checks a schema can't express (overlapping plans, wrong charge class, unpriced gaps) |
hems.setup |
setup steps in order: site → meter → plan → tariffs |
hems.profile_v1 |
imports a franklinwh-bridge/tariff-profile v1 file as an OUTUS plan |
hems.wear |
battery wear: warranty setup fields, wear cost per kWh, throughput pace budget, dispatch events, round-trip efficiency from SoC-matched cycles |
hems.forecast |
solar (irradiance × kWp, cell temperature, self-calibration), the load model (calendar × season, comfort band, cold start), battery temperature limit, walk-forward backtest, HAEO publishing |
hems.loads |
HEMS setup: device types (value → label), always-on load and usage periods to confirm, heavy loads and EV charger checked against capabilities, expected hours, soak trigger |
hems.dispatch |
Smart Dispatch: the questions to ask once a plan is entered (target: Emergency Backup only, TOU, lowest cost with demand charges, self-consumption, most export earnings; SoC band; grid charging and export allowed, limited or prohibited), prices per step from a plan, a 24-hour SoC plan by dynamic programming (never worse than self-consumption), the action now |
hems.adapters.open_meteo |
Open-Meteo forecast and archive: irradiance and temperature rows (does network I/O) |
pip install -e ".[test]"
pytest
The tests check every bill hems writes against the OUTUS v1 schemas, copied in
tests/outus-v1/.
Licence
MIT
Metadata
Release files for hems 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hems-0.3.0.tar.gz | 55.9 kB | With provenance | Details for hems-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hems-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for hems-0.3.0-py3-none-any.whl |
Total release size: 101.6 kB
Release files / hems-0.3.0.tar.gz
| Download URL | hems-0.3.0.tar.gz |
|---|---|
| Size | 55.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d90f61579288e1563cb87f3c0337504efcd07ff073daeb2bd51401f12711b71a
|
|
BLAKE2b-256 checksum How to use checksums |
354bdcb4230e579e697ac756d1ee3de1877e3869e3b4c23b823509cb85bbaa5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / hems-0.3.0-py3-none-any.whl
| Download URL | hems-0.3.0-py3-none-any.whl |
|---|---|
| Size | 45.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
336e922d42692521c161afd32d8cdda0d1dcf092f57b0f3860fa3dfed79fab82
|
|
BLAKE2b-256 checksum How to use checksums |
9cfb59ea79c496ae487ac5cf55941036c13ce821cc9a405e68f579503f2fa7f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for hems 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for hems-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.