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("batteryConfigured")
36 private boolean batteryConfigured;
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("gridConfigured")
51 private boolean gridConfigured;
53 @SerializedName("gridPower")
54 private float gridPower;
56 @SerializedName("homePower")
57 private float homePower;
59 @SerializedName("loadpoints")
60 private Loadpoint[] loadpoints;
62 @SerializedName("prioritySoc")
63 private float prioritySoC;
65 @SerializedName("bufferSoc")
66 private float bufferSoC;
68 @SerializedName("bufferStartSoc")
69 private float bufferStartSoC;
71 @SerializedName("residualPower")
72 private float residualPower;
74 @SerializedName("pvConfigured")
75 private boolean pvConfigured;
77 @SerializedName("pvPower")
78 private float pvPower;
80 @SerializedName("siteTitle")
81 private String siteTitle;
83 @SerializedName("vehicles")
84 private Map<String, Vehicle> vehicles;
86 @SerializedName("version")
87 private String version;
89 @SerializedName("availableVersion")
90 private String availableVersion;
93 * @return battery's capacity
95 public float getBatteryCapacity() {
96 return batteryCapacity;
100 * @return whether battery is configured
102 public boolean getBatteryConfigured() {
103 return batteryConfigured;
107 * @return battery's power
109 public float getBatteryPower() {
114 * @return battery's priority state of charge
116 public float getPrioritySoC() {
121 * @return Battery Buffer SoC
123 public float getBufferSoC() {
128 * @return Battery Buffer Start SoC
130 public float getBufferStartSoC() {
131 return bufferStartSoC;
135 * @return Grid Residual Power
137 public float getResidualPower() {
138 return residualPower;
142 * @return battery's state of charge
144 public float getBatterySoC() {
149 * @return battery discharge control
151 public boolean getBatteryDischargeControl() {
152 return batteryDischargeControl;
156 * @return battery mode
158 public String getBatteryMode() {
163 * @return whether grid is configured
165 public boolean getGridConfigured() {
166 return gridConfigured;
170 * @return grid's power
172 public float getGridPower() {
177 * @return home's power
179 public float getHomePower() {
184 * @return all configured loadpoints
186 public Loadpoint[] getLoadpoints() {
191 * @return whether pv is configured
193 public boolean getPvConfigured() {
200 public float getPvPower() {
205 * @return site's title/name
207 public String getSiteTitle() {
211 public Map<String, Vehicle> getVehicles() {
216 * @return evcc version
218 public String getVersion() {
223 * @return evcc available version
225 public String getAvailableVersion() {
226 return availableVersion;