Markdown Reference
Every supported Markdown element with an example — use this page to check formatting and styles.
This page demonstrates every Markdown element supported in metrd docs. Use it to verify styling when making changes to the docs theme.
Headings
H1 — Page title (rendered from frontmatter, not used in body)
H2 — Section heading
H3 — Subsection heading
Paragraphs
A standard paragraph. metrd polls your inverter every few seconds and writes readings to a local SQLite database. Nothing leaves your network by default.
A second paragraph. Readings are exposed via a REST API on http://localhost:3000/api and visualised in the built-in dashboard. You can also query the database directly if you prefer.
Inline formatting
Bold text for emphasis on key terms.
Regular text with inline code for register names, config keys, env vars like GIVENERGY_MODE, and short values like true or 8899.
Blockquotes
This is a plain blockquote. Useful for supplementary context that isn't strictly a warning.
Note: Cloud mode data can lag by up to 60 seconds compared to local polling. For real-time dashboards, use local Modbus or the local HTTP API where available.
Alert states
Cloud mode data can lag by up to 60 seconds compared to local polling.
Use local Modbus polling for real-time dashboards where latency matters.
You must set
GIVENERGY_HOSTwhen using local mode.
Changing the Modbus unit ID will break the connection until the inverter is reconfigured.
Downgrading firmware may permanently disable cloud connectivity.
Lists
Unordered
- Solar PV generation (W and Wh)
- Grid import and export
- Battery charge, discharge, and state of charge
- House load
- Individual circuit clamps if your hardware supports them
Ordered
- Log in to your inverter portal
- Navigate to Account → API
- Generate a new token
- Copy the token into your
.envfile asAPI_KEY
Nested
- Hardware providers
- GivEnergy
- Cloud API
- Local Modbus
- SolaX
- Cloud API
- Local API
- GivEnergy
- Reference
Code blocks
Bash
git clone https://github.com/metrd/metrd
cd metrd
cp .env.example .env
docker compose up -dPlain text (registers, output)
40001 - Solar PV power (W)
40002 - Grid import/export (W)
40006 - Battery power (W)
40007 - Battery state of charge (%)
40008 - House load (W)
40070 - Battery temperature (°C)JSON
{
"status": "ok",
"version": "1.0.0",
"readings": {
"pv_power": 2340,
"grid_power": -180,
"battery_soc": 87,
"battery_power": 1200,
"load_power": 960
}
}Long line (should scroll, not wrap)
curl -s "http://localhost:3000/api/readings?from=2024-01-01T00:00:00Z&to=2024-01-01T23:59:59Z&interval=5m&fields=pv_power,grid_power,battery_soc" | jq '.readings[] | select(.pv_power > 1000)'Tables
Simple
| Field | Unit | Description |
|---|---|---|
pv_power | W | Solar generation |
grid_power | W | Import positive, export negative |
battery_power | W | Discharge positive, charge negative |
battery_soc | % | State of charge |
load_power | W | House consumption |
With code in cells (should not wrap)
| Environment variable | Default | Description |
|---|---|---|
GIVENERGY_MODE | local | cloud or local |
GIVENERGY_HOST | — | Inverter IP for local mode |
GIVENERGY_PORT | 8899 | Modbus TCP port |
GIVENERGY_UNIT_ID | 1 | Modbus unit ID |
BATTERY_CHARGE_THRESHOLD | 50 | Minimum W to count as charging |
BATTERY_CHARGE_GAP | 120 | Seconds gap before session ends |
With links
| Resource | Link |
|---|---|
| GivEnergy support | givenergy.co.uk/support(opens in new tab) |
| Modbus specification | modbus.org(opens in new tab) |
Links
Internal
See the installation guide to get started.
External
GivEnergy inverters use Modbus TCP(opens in new tab) for local communication. The full register map is available from GivEnergy support(opens in new tab).
Strong in prose
metrd is read-only. It will never write to your inverter, change charge schedules, or modify tariff slots. If you need control, use your inverter's own app.
The battery power register uses a signed integer — positive means discharging, negative means charging. metrd preserves the sign without normalisation.