Document Bento spreader 3 deployment

This commit is contained in:
admin committed 2026-10-02 20:39:45 +02:00
1 parent 7ff3087775
commit c0d1c0aa79
4 files changed
+159 -63

No files matched your search

+65 -10
View File
@@ -101,7 +101,8 @@ utility: `Stundenleistung Anlage` is gated by `Geschwindigkeit Gesamtanlage > 0.
2,672 common samples yield **5.205555556 h** and **5,180.127150811 kg** for run
00842, matching the previous manual calculation's rounded results. Synthetic
tests verify equivalence to manual interval integration without local captures
or live ENLYZE access. Grafana and Bento 1 remain pending.
or live ENLYZE access. See [Bento 1 documentation](docs/bento1-fresh-bentonite.md)
for its implemented material sources and verified deployment.
`MaterialPollingService.poll_once(now=...)` starts at the open run's start or
resumes inclusively at its last processed timestamp. Duplicate boundary samples
@@ -218,17 +219,68 @@ The primary key deduplicates calculation/machine/order/timestamp (first write wi
A short transaction opens and closes one synchronous connection per snapshot,
with 10-second connection and statement timeouts. Snapshot timestamps are poll
start times, not source-sample timestamps. Schema application is manual.
Bento 1 bentonite source and gate selection remain intentionally undefined pending
process validation; the generic integration core is unchanged and reusable.
Bento 1 uses the generic integration core for spreaders 1+2 and a separate
Spreader 3 source. See [Bento 1 configuration and deployment](docs/bento1-fresh-bentonite.md)
for verified machine-specific details.
## Generic ENLYZE power meters
`config/power-meters.example.yaml` is the configuration-only B2 starting point.
It contains the verified machine, energy, active-power and frequency UUIDs; K1
and K6 are added as more `meters` entries without new code. Optional phase
channels are a mapping and may omit L2. `power_outages` is intentionally absent
until its real UUID is verified from the raw second `/v2/variables` page/register
1828; sanitized placeholders are never accepted.
As of 2026-10-01, the collector is running for B2 with total active power,
L2 active power, total energy, grid frequency, and Power Outages
(operator-confirmed production state; sandbox systemd access cannot independently
confirm live status). Both additional signals are verified and configured.
| B2 signal | Verified ENLYZE UUID | Register |
| --- | --- | --- |
| L2 active power | `d9ae584e-551b-44b8-a822-3cf9554e77e4` | `3055` |
| Power Outages | `ea1f1f51-1758-4818-8ec3-fbb4b76d1a77` | `1828` |
`config/power-meters.example.yaml` contains the verified B2 machine and signals.
K1 and K6 can be added as more `meters` entries without new code. Phase channels
remain optional for other meters; B2 has L2 configured.
### Production service and runtime settings
The deployed unit is `/etc/systemd/system/production-analytics-power-meter.service`.
It runs as `mtazl` from `/opt/git-projects/production-analytics`, using the repository
venv and B2 configuration with `--meter B2 --follow` at a 60-second interval.
It sets `PYTHONUNBUFFERED=1`, `Restart=always`, and `RestartSec=10`.
The unit loads the repository `.env` through an optional systemd
`EnvironmentFile`; the CLI itself does **not** automatically load `.env`.
Required effective settings are `ENLYZE_BASE_URL` (use
`https://app.enlyze.com/api/`), `ENLYZE_API_KEY`, `POSTGRES_HOST`, `POSTGRES_PORT`,
`POSTGRES_DB`, `POSTGRES_USER`, and `POSTGRES_PASSWORD`.
`ENLYZE_HTTP_TIMEOUT_SECONDS` is optional (default 20).
Compose requires `POSTGRES_PASSWORD` in `.env`; optional `POSTGRES_PORT` controls
the published database port. The collector password must match the database.
Keep credentials in ignored local files. The unit explicitly passes absolute
paths to `secrets/enlyze.env` and `secrets/postgres.env` in the repository.
The CLI merges process environment, ENLYZE secret file, then PostgreSQL secret
file; later file values override earlier ones. Files accept simple `KEY=VALUE`
assignments with optional quotes and are parsed without shell execution.
Do not commit `.env` or secret files or pass credentials as command arguments.
After dependencies, runtime settings, database, and schema are ready, use these
commands on the production host:
```bash
sudo systemctl start production-analytics-power-meter.service
sudo systemctl restart production-analytics-power-meter.service
systemctl status production-analytics-power-meter.service --no-pager
journalctl -u production-analytics-power-meter.service -n 100 --no-pager
journalctl -u production-analytics-power-meter.service -f
```
Restart after changing runtime settings. For foreground collection from the
repository root, provide settings through exported variables or secret files:
```bash
.venv/bin/production-analytics run power-meter \
--config config/power-meters.example.yaml --meter B2 --follow \
--secrets-file secrets/enlyze.env --db-secrets-file secrets/postgres.env
```
Apply `db/schema.sql`, then run a bounded collection/backfill with ENLYZE and
PostgreSQL values from the environment or secret files:
@@ -238,7 +290,10 @@ production-analytics run power-meter --config config/power-meters.example.yaml \
--meter B2 --start 2026-09-01T00:00:00Z --end 2026-10-01T00:00:00Z
```
Generate the independent monthly PDF (under the configured mounted SMB path):
**SMB report mount still pending:** `/mnt/reports/energy` is configured but the
SMB share has not yet been mounted/verified. Production report delivery remains
pending; collection is independent of the mount. Once the mount and PDF renderer
are ready, generate the independent monthly PDF:
```bash
production-analytics report monthly --config config/power-meters.example.yaml \