evcc (self-hosted) Battery API

The battery API from evcc (self-hosted) — 12 operation(s) for battery.

Business capability
Home Energy AE-200.30

Operations 12

POST /batterydischargecontrol/{enable} Control battery-discharge #
POST /batterygriddischarge/{enable} Control battery grid discharge #
DELETE /batterygridchargelimit Remove battery grid charge limit #
POST /batterygridchargelimit/{cost} Set battery grid charge limit #
DELETE /batterygriddischargelimit Remove battery grid discharge limit #
POST /batterygriddischargelimit/{cost} Set battery grid discharge limit #
DELETE /batterymode Disable external battery control #
POST /batterymode/{batteryMode} Set external battery mode #
POST /buffersoc/{soc} Set battery buffer SoC #
POST /bufferstartsoc/{soc} Set battery buffer start SoC #
POST /prioritysoc/{soc} Set battery priority SoC #
POST /residualpower/{power} Set grid residual power #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/evcc:evcc-battery-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

evcc-battery-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: evcc Battery API
  description: smart charging. open source energy management.
  version: 0.2.0
  contact:
    url: https://github.com/evcc-io/evcc
servers:
- url: https://demo.evcc.io/api
tags:
- name: battery
paths:
  /batterydischargecontrol/{enable}:
    post:
      operationId: setBatteryDischargeControl
      summary: Control battery-discharge
      description: Prevent home battery discharge during vehicle fast charging.
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/enable'
      responses:
        '200':
          $ref: '#/components/responses/BooleanResult'
  /batterygriddischarge/{enable}:
    post:
      operationId: setBatteryGridDischarge
      summary: Control battery grid discharge
      description: Allow the home battery to discharge to the grid. Enabling may require `force=true` to confirm country-specific grid export restrictions.
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/enable'
      - name: force
        in: query
        description: Confirm country-specific grid export restrictions
        schema:
          type: boolean
      responses:
        '200':
          $ref: '#/components/responses/BooleanResult'
        '428':
          description: Confirmation required
  /batterygridchargelimit:
    delete:
      operationId: removeBatteryGridChargeLimit
      summary: Remove battery grid charge limit
      description: Remove battery grid charge limit.
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      responses:
        '200':
          $ref: '#/components/responses/NullResult'
  /batterygridchargelimit/{cost}:
    post:
      operationId: setBatteryGridChargeLimit
      summary: Set battery grid charge limit
      description: Charge home battery from grid when price or emissions are below the threshold. Uses price if a dynamic tariff exists. Uses emissions if a CO₂-tariff is configured. Ignored otherwise.
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/costLimit'
      responses:
        '200':
          $ref: '#/components/responses/NumberResult'
  /batterygriddischargelimit:
    delete:
      operationId: removeBatteryGridDischargeLimit
      summary: Remove battery grid discharge limit
      description: Remove battery grid discharge limit (experimental).
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      responses:
        '200':
          $ref: '#/components/responses/NullResult'
  /batterygriddischargelimit/{cost}:
    post:
      operationId: setBatteryGridDischargeLimit
      summary: Set battery grid discharge limit
      description: Discharge home battery to grid when the grid export price is at or above the threshold (experimental). Requires a grid export tariff and the battery grid discharge setting. Ignored otherwise.
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/costLimit'
      responses:
        '200':
          $ref: '#/components/responses/NumberResult'
  /batterymode:
    delete:
      operationId: disableExternalBatteryControl
      summary: Disable external battery control
      description: Default evcc control behavior is restored
      tags:
      - battery
      responses:
        '200':
          $ref: '#/components/responses/BatteryModeResult'
  /batterymode/{batteryMode}:
    post:
      operationId: setExternalBatteryMode
      summary: Set external battery mode
      description: Directly controls the mode of all controllable batteries. evcc behavior like 'price limit' or 'prevent discharge while fast charging' is overruled. External mode resets after 60s. The external system has to call this endpoint regularly.
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/batteryMode'
      responses:
        '200':
          $ref: '#/components/responses/BatteryModeResult'
  /buffersoc/{soc}:
    post:
      operationId: setBufferSoc
      summary: Set battery buffer SoC
      description: Set battery buffer SoC.
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/soc'
      responses:
        '200':
          $ref: '#/components/responses/NumberResult'
  /bufferstartsoc/{soc}:
    post:
      operationId: setBufferStartSoc
      summary: Set battery buffer start SoC
      description: Set battery buffer start SoC.
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/soc'
      responses:
        '200':
          $ref: '#/components/responses/NumberResult'
  /prioritysoc/{soc}:
    post:
      operationId: setPrioritySoc
      summary: Set battery priority SoC
      description: Set battery priority SoC.
      externalDocs:
        url: https://docs.evcc.io/en/features/battery
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/soc'
      responses:
        '200':
          $ref: '#/components/responses/NumberResult'
  /residualpower/{power}:
    post:
      operationId: setResidualPower
      summary: Set grid residual power
      description: Set grid connection operating point.
      externalDocs:
        url: https://docs.evcc.io/en/reference/configuration/site#residualpower
      tags:
      - battery
      parameters:
      - $ref: '#/components/parameters/power'
      responses:
        '200':
          $ref: '#/components/responses/NumberResult'
components:
  schemas:
    Soc:
      description: SoC in %
      type: number
      example: 60
      minimum: 0
      maximum: 100
    Power:
      description: Power in W
      type: number
      minimum: 0
      example: 2500
    BatteryMode:
      description: Battery operation mode.
      type: string
      enum:
      - unknown
      - normal
      - hold
      - charge
      - holdcharge
      - discharge
  parameters:
    batteryMode:
      name: batteryMode
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/BatteryMode'
    costLimit:
      name: cost
      description: Cost limit in configured currency (default EUR) or CO₂ limit in g/kWh
      example: 0.25
      in: path
      required: true
      schema:
        type: number
    power:
      name: power
      description: Power in W
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Power'
    soc:
      name: soc
      description: SoC in %
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Soc'
    enable:
      name: enable
      description: Charging mode.
      in: path
      required: true
      schema:
        type: string
        enum:
        - 'true'
        - 'false'
        - '1'
        - '0'
  responses:
    BooleanResult:
      description: Success - Boolean result
      content:
        application/json:
          schema:
            type: boolean
    BatteryModeResult:
      description: Battery mode
      content:
        application/json:
          schema:
            type: integer
            description: 'Battery mode. 0: unknown, 1: normal, 2: hold, 3: charge, 4: holdcharge, 5: discharge'
            minimum: 0
            maximum: 5
    NullResult:
      description: Success - Null result
      content:
        application/json:
          schema:
            description: Value is always null
            nullable: true
            type: object
    NumberResult:
      description: Success - Number result
      content:
        application/json:
          schema:
            type: number
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: auth
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Long-lived API key (prefixed `evcc_`, managed via /auth/apikey).

        Grants access to /api/db/* without requiring the X-Admin-Password header.

        '