Skip to content

Commit 1fb0916

Browse files
Maschganaltatis
andauthored
REST: Add batterymode-endpoint (#750)
Co-authored-by: Michael Geers <[email protected]>
1 parent 94ce5d4 commit 1fb0916

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"deploy": "docusaurus deploy",
1414
"clear": "docusaurus clear",
1515
"serve": "docusaurus serve",
16-
"format": "prettier --write . && node src/sortOpenAPI.js",
16+
"format": "prettier --write . && npm run sort",
17+
"sort": "node src/sortOpenAPI.js",
1718
"write-translations": "docusaurus write-translations",
1819
"write-heading-ids": "docusaurus write-heading-ids"
1920
},

static/rest-api.yaml

+47
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,26 @@ paths:
147147
responses:
148148
"200":
149149
$ref: "#/components/responses/NumberResult"
150+
/batterymode:
151+
delete:
152+
summary: Disable external battery control
153+
description: Default evcc control behavior is restored
154+
tags:
155+
- Home Battery
156+
responses:
157+
"200":
158+
$ref: "#/components/responses/BatteryModeResult"
159+
/batterymode/{batteryMode}:
160+
post:
161+
summary: Set external battery mode
162+
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.
163+
tags:
164+
- Home Battery
165+
parameters:
166+
- $ref: "#/components/parameters/batteryMode"
167+
responses:
168+
"200":
169+
$ref: "#/components/responses/BatteryModeResult"
150170
/buffersoc/{soc}:
151171
post:
152172
summary: Set battery buffer SoC
@@ -966,6 +986,15 @@ paths:
966986
$ref: "#/components/schemas/StaticSocPlan"
967987
components:
968988
schemas:
989+
BatteryMode:
990+
description: TODO
991+
type: string
992+
example: normal
993+
enum:
994+
- unknown
995+
- normal
996+
- hold
997+
- charge
969998
ChangePassword:
970999
type: object
9711000
properties:
@@ -1335,6 +1364,12 @@ components:
13351364
required: true
13361365
schema:
13371366
$ref: "#/components/schemas/Power"
1367+
batteryMode:
1368+
name: batteryMode
1369+
in: path
1370+
required: true
1371+
schema:
1372+
$ref: "#/components/schemas/BatteryMode"
13381373
costLimit:
13391374
name: cost
13401375
description: Cost limit in configured currency (default EUR) or CO2 limit in g/kWh
@@ -1445,6 +1480,18 @@ components:
14451480
type: string
14461481
enum:
14471482
- Unauthorized
1483+
BatteryModeResult:
1484+
content:
1485+
application/json:
1486+
schema:
1487+
type: object
1488+
properties:
1489+
result:
1490+
type: integer
1491+
description: |
1492+
Battery mode. 0: unknown, 1: normal, 2: hold, 3: charge
1493+
minimum: 0
1494+
maximum: 3
14481495
securitySchemes:
14491496
cookieAuth:
14501497
type: apiKey

0 commit comments

Comments
 (0)