]> git.basschouten.com Git - openhab-addons.git/blob
598ee3f7028888eeae984f67c57c0186f57ebfbf
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.evcc.internal.api.dto;
14
15 import java.util.Map;
16
17 import com.google.gson.annotations.SerializedName;
18
19 /**
20  * This class represents the result object of the status response (/api/state).
21  * This DTO was written for evcc version 0.123.1
22  *
23  * @author Florian Hotze - Initial contribution
24  * @author Luca Arnecke - update to evcc version 0.123.1
25  */
26 public class Result {
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
29
30     // "auth" is left out because it does not provide any useful information
31
32     @SerializedName("batteryCapacity")
33     private float batteryCapacity;
34
35     @SerializedName("battery")
36     private Battery[] battery;
37
38     @SerializedName("batteryPower")
39     private float batteryPower;
40
41     @SerializedName("batterySoc")
42     private float batterySoC;
43
44     @SerializedName("batteryDischargeControl")
45     private boolean batteryDischargeControl;
46
47     @SerializedName("batteryMode")
48     private String batteryMode;
49
50     @SerializedName("gridCurrents")
51     private float[] gridCurrents;
52
53     @SerializedName("gridEnergy")
54     private float gridEnergy;
55
56     @SerializedName("gridPower")
57     private Float gridPower;
58
59     @SerializedName("homePower")
60     private float homePower;
61
62     @SerializedName("loadpoints")
63     private Loadpoint[] loadpoints;
64
65     @SerializedName("prioritySoc")
66     private float prioritySoC;
67
68     @SerializedName("bufferSoc")
69     private float bufferSoC;
70
71     @SerializedName("bufferStartSoc")
72     private float bufferStartSoC;
73
74     @SerializedName("residualPower")
75     private float residualPower;
76
77     @SerializedName("pv")
78     private PV[] pv;
79
80     @SerializedName("pvPower")
81     private float pvPower;
82
83     @SerializedName("siteTitle")
84     private String siteTitle;
85
86     @SerializedName("vehicles")
87     private Map<String, Vehicle> vehicles;
88
89     @SerializedName("version")
90     private String version;
91
92     @SerializedName("availableVersion")
93     private String availableVersion;
94
95     /**
96      * @return all configured batteries
97      */
98     public Battery[] getBattery() {
99         return battery;
100     }
101
102     /**
103      * @return battery's capacity
104      */
105     public float getBatteryCapacity() {
106         return batteryCapacity;
107     }
108
109     /**
110      * @return battery's power
111      */
112     public float getBatteryPower() {
113         return batteryPower;
114     }
115
116     /**
117      * @return battery's priority state of charge
118      */
119     public float getPrioritySoC() {
120         return prioritySoC;
121     }
122
123     /**
124      * @return Battery Buffer SoC
125      */
126     public float getBufferSoC() {
127         return bufferSoC;
128     }
129
130     /**
131      * @return Battery Buffer Start SoC
132      */
133     public float getBufferStartSoC() {
134         return bufferStartSoC;
135     }
136
137     /**
138      * @return Grid Residual Power
139      */
140     public float getResidualPower() {
141         return residualPower;
142     }
143
144     /**
145      * @return battery's state of charge
146      */
147     public float getBatterySoC() {
148         return batterySoC;
149     }
150
151     /**
152      * @return battery discharge control
153      */
154     public boolean getBatteryDischargeControl() {
155         return batteryDischargeControl;
156     }
157
158     /**
159      * @return battery mode
160      */
161     public String getBatteryMode() {
162         return batteryMode;
163     }
164
165     /**
166      * @return grid's currents
167      */
168     public float[] getGridCurrents() {
169         return gridCurrents;
170     }
171
172     /**
173      * @return grid's energy
174      */
175     public float getGridEnergy() {
176         return gridEnergy;
177     }
178
179     /**
180      * @return grid's power or {@code null} if not available
181      */
182     public Float getGridPower() {
183         return gridPower;
184     }
185
186     /**
187      * @return home's power
188      */
189     public float getHomePower() {
190         return homePower;
191     }
192
193     /**
194      * @return all configured loadpoints
195      */
196     public Loadpoint[] getLoadpoints() {
197         return loadpoints;
198     }
199
200     /**
201      * @return all configured PVs
202      */
203     public PV[] getPV() {
204         return pv;
205     }
206
207     /**
208      * @return pv's power
209      */
210     public float getPvPower() {
211         return pvPower;
212     }
213
214     /**
215      * @return site's title/name
216      */
217     public String getSiteTitle() {
218         return siteTitle;
219     }
220
221     public Map<String, Vehicle> getVehicles() {
222         return vehicles;
223     }
224
225     /**
226      * @return evcc version
227      */
228     public String getVersion() {
229         return version;
230     }
231
232     /**
233      * @return evcc available version
234      */
235     public String getAvailableVersion() {
236         return availableVersion;
237     }
238 }