2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.evcc.internal.api.dto;
17 import com.google.gson.annotations.SerializedName;
20 * This class represents the result object of the status response (/api/state).
21 * This DTO was written for evcc version 0.123.1
23 * @author Florian Hotze - Initial contribution
24 * @author Luca Arnecke - update to evcc version 0.123.1
27 // Data types from https://github.com/evcc-io/evcc/blob/master/api/api.go
28 // and from https://docs.evcc.io/docs/reference/configuration/messaging/#msg
30 // "auth" is left out because it does not provide any useful information
32 @SerializedName("batteryCapacity")
33 private float batteryCapacity;
35 @SerializedName("battery")
36 private Battery[] battery;
38 @SerializedName("batteryPower")
39 private float batteryPower;
41 @SerializedName("batterySoc")
42 private float batterySoC;
44 @SerializedName("batteryDischargeControl")
45 private boolean batteryDischargeControl;
47 @SerializedName("batteryMode")
48 private String batteryMode;
50 @SerializedName("gridCurrents")
51 private float[] gridCurrents;
53 @SerializedName("gridEnergy")
54 private float gridEnergy;
56 @SerializedName("gridPower")
57 private Float gridPower;
59 @SerializedName("homePower")
60 private float homePower;
62 @SerializedName("loadpoints")
63 private Loadpoint[] loadpoints;
65 @SerializedName("prioritySoc")
66 private float prioritySoC;
68 @SerializedName("bufferSoc")
69 private float bufferSoC;
71 @SerializedName("bufferStartSoc")
72 private float bufferStartSoC;
74 @SerializedName("residualPower")
75 private float residualPower;
80 @SerializedName("pvPower")
81 private float pvPower;
83 @SerializedName("siteTitle")
84 private String siteTitle;
86 @SerializedName("vehicles")
87 private Map<String, Vehicle> vehicles;
89 @SerializedName("version")
90 private String version;
92 @SerializedName("availableVersion")
93 private String availableVersion;
96 * @return all configured batteries
98 public Battery[] getBattery() {
103 * @return battery's capacity
105 public float getBatteryCapacity() {
106 return batteryCapacity;
110 * @return battery's power
112 public float getBatteryPower() {
117 * @return battery's priority state of charge
119 public float getPrioritySoC() {
124 * @return Battery Buffer SoC
126 public float getBufferSoC() {
131 * @return Battery Buffer Start SoC
133 public float getBufferStartSoC() {
134 return bufferStartSoC;
138 * @return Grid Residual Power
140 public float getResidualPower() {
141 return residualPower;
145 * @return battery's state of charge
147 public float getBatterySoC() {
152 * @return battery discharge control
154 public boolean getBatteryDischargeControl() {
155 return batteryDischargeControl;
159 * @return battery mode
161 public String getBatteryMode() {
166 * @return grid's currents
168 public float[] getGridCurrents() {
173 * @return grid's energy
175 public float getGridEnergy() {
180 * @return grid's power or {@code null} if not available
182 public Float getGridPower() {
187 * @return home's power
189 public float getHomePower() {
194 * @return all configured loadpoints
196 public Loadpoint[] getLoadpoints() {
201 * @return all configured PVs
203 public PV[] getPV() {
210 public float getPvPower() {
215 * @return site's title/name
217 public String getSiteTitle() {
221 public Map<String, Vehicle> getVehicles() {
226 * @return evcc version
228 public String getVersion() {
233 * @return evcc available version
235 public String getAvailableVersion() {
236 return availableVersion;