API & MCP

Everything a person can do on Ledgerly Home Battery Simulator, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Ledgerly Home Battery Simulator

Simulates a year hour by hour: solar power from the offline yield model (or your monthly figures), your consumption from a smart-meter export, hourly values or a simple household profile, and a battery with its capacity, power and losses. Compares several sizes by self-consumption, self-sufficiency, grid import, export, cycles and the money each one saves. Part of Ledgerly’s Solar & Heat.

Inputs of Ledgerly Home Battery Simulator
FieldTypeDefaultDescription
currencytext"EUR"Currency
latitudenumber52.52Latitude (°, south negative)
longitudenumber13.405Longitude (°, west negative)
peakPowerKwnumber8Peak power of the PV system (kWp)
tiltnumber35Tilt (° from horizontal)
azimuthnumber0Orientation (° from south: east −90, west 90)
layoutselect (single, east-west)"single"Panel layout
utcOffsetnumber1Time zone (hours from UTC, standard time)
pvMonthlyKwhtext—PV yield per month (kWh, 12 values; empty = offline estimate). Paste the monthly figures from the yield calculation or PVGIS; the daily curve still comes from the sun’s path.
annualLoadKwhnumber—Electricity use per year (kWh; empty = from the profile). With the built-in profile an empty value means 4,000 kWh. With your own profile it rescales the profile to this total.
loadProfiletextarea—Your load profile: 24, 288 or 8,760 hourly kWh values, or smart-meter readings. Empty = Ledgerly’s simple household profile. Meter readings: one line per reading with date, time and kWh.
batteryKwhnumber8Usable battery capacity (kWh)
compareCapacitiestext"0, 5, 10, 15"Also compare these capacities (kWh)
batteryPowerKwnumber4Battery charge and discharge power (kW)
roundTripEfficiencyPercentnumber90Round-trip efficiency (%)
exportLimitKwnumber0Feed-in limit (kW, 0 = none)
electricityPricenumber0.35Electricity price per kWh
feedInTariffnumber0.078Feed-in payment per kWh
seedinteger1Weather sequence (seed). Sunny, mixed and dull days are drawn from this seed; the same seed always gives the same year.

Example request

8 kWp in Berlin, 4,000 kWh, 8 kWh battery

curl -X POST https://ledgerlybatterysim.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"latitude":52.52,"longitude":13.405,"peakPowerKw":8,"annualLoadKwh":4000,"batteryKwh":8}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "ledgerly-battery-sim": { "type": "http", "url": "https://ledgerlybatterysim.usefulweb.app/mcp" }
  }
}