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_HOST when 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

  1. Log in to your inverter portal
  2. Navigate to Account → API
  3. Generate a new token
  4. Copy the token into your .env file as API_KEY

Nested

  • Hardware providers
    • GivEnergy
      • Cloud API
      • Local Modbus
    • SolaX
      • Cloud API
      • Local API
  • Reference

Code blocks

Bash

git clone https://github.com/metrd/metrd
cd metrd
cp .env.example .env
docker compose up -d

Plain 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

FieldUnitDescription
pv_powerWSolar generation
grid_powerWImport positive, export negative
battery_powerWDischarge positive, charge negative
battery_soc%State of charge
load_powerWHouse consumption

With code in cells (should not wrap)

Environment variableDefaultDescription
GIVENERGY_MODElocalcloud or local
GIVENERGY_HOSTInverter IP for local mode
GIVENERGY_PORT8899Modbus TCP port
GIVENERGY_UNIT_ID1Modbus unit ID
BATTERY_CHARGE_THRESHOLD50Minimum W to count as charging
BATTERY_CHARGE_GAP120Seconds gap before session ends
ResourceLink
GivEnergy supportgivenergy.co.uk/support(opens in new tab)
Modbus specificationmodbus.org(opens in new tab)

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.


Images

metrd dashboard screenshot showing solar generation and battery state
A smaller image with a caption
This is the image caption