Skip to content

Commit

Permalink
Fronius Solar API: add battery control (#11879)
Browse files Browse the repository at this point in the history
  • Loading branch information
berndkrannich authored Jan 27, 2024
1 parent 7c73831 commit 91592bb
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions templates/definition/meter/fronius-solarapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ products:
- brand: Fronius
description:
generic: Solar API V1
capabilities: ["battery-control"]
params:
- name: usage
choice: ["grid", "pv", "battery"]
allinone: true
- name: host
- name: capacity
advanced: true
- name: user
required: false
- name: password
required: false
render: |
type: custom
power:
Expand All @@ -27,6 +32,45 @@ render: |
source: http
uri: http://{{ .host }}/solar_api/v1/GetPowerFlowRealtimeData.fcgi
jq: .Body.Data.Inverters."1".SOC
batterymode:
source: switch
switch:
- case: 1 # normal
set:
source: http
uri: http://{{ .host }}/config/timeofuse
method: POST
headers:
- content-type: application/json
auth:
type: digest
user: {{ .user }}
password: {{ .password }}
body: '{"timeofuse":[]}'
- case: 2 # hold
set:
source: http
uri: http://{{ .host }}/config/timeofuse
method: POST
headers:
- content-type: application/json
auth:
type: digest
user: {{ .user }}
password: {{ .password }}
body: '{"timeofuse":[{"Active":true,"Power":0,"ScheduleType":"DISCHARGE_MAX","TimeTable":{"Start":"00:00","End":"23:59"},"Weekdays":{"Mon":true,"Tue":true,"Wed":true,"Thu":true,"Fri":true,"Sat":true,"Sun":true}}]}'
- case: 3 # charge
set:
source: http
uri: http://{{ .host }}/config/timeofuse
method: POST
headers:
- content-type: application/json
auth:
type: digest
user: {{ .user }}
password: {{ .password }}
body: '{"timeofuse":[]}'
{{- if .capacity }}
capacity: {{ .capacity }} # kWh
{{- end }}
Expand Down

0 comments on commit 91592bb

Please sign in to comment.