evcc-io/templates/definition/meter/openems.yaml
2025-11-23 10:39:44 +01:00

172 lines
5.1 KiB
YAML

template: openems
products:
- brand: OpenEMS
description:
generic: REST-API
- brand: FENECON
description:
generic: REST-API
capabilities: ["battery-control"]
requirements:
description:
de: |
##### Lizenzhinweis:
Für FENECON FEMS Systeme ist für die aktive Batteriesteuerung eine kommerzielle Lizenz *FEMS App REST/JSON Schreibzugriff* erforderlich.<br/><br/>
##### FEMS-Dokumentation:
- [FEMS App REST/JSON Lesezugriff](https://docs.fenecon.de/de/fems/fems-app/App_REST-JSON_Lesezugriff.html)
- [FEMS App REST/JSON Schreibzugriff](https://docs.fenecon.de/de/fems/fems-app/App_REST-JSON_Schreibzugriff.html)
##### OpenEMS-Dokumentation:
- [OpenEMS Edge REST-Api Controller](https://openems.github.io/openems.io/openems/latest/edge/controller.html#_rest_api_controller)
en: |
##### License notice:
For active battery control on FENECON FEMS systems, a commercial license (*FEMS App REST/JSON Write Access*) is required.<br/><br/>
##### FEMS documentation:
- [FEMS App REST/JSON Read Access](https://docs.fenecon.de/en/fems/fems-app/App_REST-JSON_Lesezugriff.html)
- [FEMS App REST/JSON Write Access](https://docs.fenecon.de/en/fems/fems-app/App_REST-JSON_Schreibzugriff.html)
##### OpenEMS documentation:
- [OpenEMS Edge REST-Api Controller](https://openems.github.io/openems.io/openems/latest/edge/controller.html#_rest_api_controller)
params:
- name: usage
choice: ["grid", "pv", "battery"]
allinone: true
- name: host
- name: password
mask: true
default: user
advanced: true
- name: battery
example: ess0
description:
de: Steuerbare Batterie Komponente
en: Controllable battery component
help:
de: aktive Batteriesteuerung (REST/JSON schreibend)
en: active battery control (REST/JSON Write Access)
usages: ["battery"]
advanced: true
- name: watchdog
type: duration
default: 60s
description:
de: FEMS/OpenEMS Batteriesteuerung API-Timeout
en: FEMS/OpenEMS battery control API timeout
help:
de: FEMS/OpenEMS Standard 60s
en: FEMS/OpenEMS standard 60s
usages: ["battery"]
advanced: true
- name: minsoc
- name: maxsoc
- name: capacity
advanced: true
- name: maxchargepower
default: 4200
- name: maxdischargepower
- name: maxacpower
render: |
type: custom
{{- if eq .usage "grid" }}
power:
source: http
uri: http://{{ .host }}/rest/channel/_sum/GridActivePower
auth:
type: basic
user: x
password: {{ .password }}
jq: (.value // 0)
energy:
source: http
uri: http://{{ .host }}/rest/channel/_sum/GridBuyActiveEnergy
auth:
type: basic
user: x
password: {{ .password }}
jq: (.value / 1000 // 0) # convert Wh to kWh
{{- end }}
{{- if eq .usage "pv" }}
power:
source: http
uri: http://{{ .host }}/rest/channel/_sum/ProductionActivePower
auth:
type: basic
user: x
password: {{ .password }}
jq: (.value // 0)
energy:
source: http
uri: http://{{ .host }}/rest/channel/_sum/ProductionActiveEnergy
auth:
type: basic
user: x
password: {{ .password }}
jq: (.value / 1000 // 0) # convert Wh to kWh
maxacpower: {{ .maxacpower }} # W
{{- end }}
{{- if eq .usage "battery" }}
power:
source: http
uri: http://{{ .host }}/rest/channel/_sum/EssDischargePower
auth:
type: basic
user: x
password: {{ .password }}
jq: (.value // 0)
soc:
source: http
uri: http://{{ .host }}/rest/channel/_sum/EssSoc
auth:
type: basic
user: x
password: {{ .password }}
jq: (.value // 0)
{{- if .battery }}
batterymode:
source: watchdog
timeout: {{ .watchdog }} # re-write at timeout/2
reset: 1
set:
source: switch
switch:
- case: 1 # normal
set:
source: http
uri: http://{{ .host }}/rest/channel/{{ .battery }}/SetActivePowerLessOrEquals
auth:
type: basic
user: x
password: {{ .password }}
method: POST
headers:
- content-type: application/json
body: '{"value": 0}'
- case: 2 # hold
set:
source: http
uri: http://{{ .host }}/rest/channel/{{ .battery }}/SetActivePowerLessOrEquals
auth:
type: basic
user: x
password: {{ .password }}
method: POST
headers:
- content-type: application/json
body: '{"value": 0}'
- case: 3 # charge
set:
source: http
uri: http://{{ .host }}/rest/channel/{{ .battery }}/SetActivePowerLessOrEquals
auth:
type: basic
user: x
password: {{ .password }}
method: POST
headers:
- content-type: application/json
body: '{"value": {{ mul .maxchargepower -1 }}}' # charge power is negative
{{- end }}
minsoc: {{ .minsoc }} # %
maxsoc: {{ .maxsoc }} # %
maxchargepower: {{ .maxchargepower }} # W
maxdischargepower: {{ .maxdischargepower }} # W
capacity: {{ .capacity }} # kWh
{{- end }}