]> git.basschouten.com Git - openhab-addons.git/blob
49f477e76944b24b824cbe9ec985e5ddcc95a6b3
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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 com.google.gson.annotations.SerializedName;
16
17 /**
18  * This class represents a loadpoint object of the status response (/api/state).
19  * This DTO was written for evcc version 0.111.1
20  *
21  * @author Florian Hotze - Initial contribution
22  */
23 public class Loadpoint {
24     // Data types from https://github.com/evcc-io/evcc/blob/master/api/api.go
25     // and from https://docs.evcc.io/docs/reference/configuration/messaging/#msg
26
27     @SerializedName("phasesActive")
28     private int activePhases;
29
30     @SerializedName("chargeCurrent")
31     private float chargeCurrent;
32
33     @SerializedName("chargeDuration")
34     private long chargeDuration;
35
36     @SerializedName("chargePower")
37     private float chargePower;
38
39     @SerializedName("chargeRemainingDuration")
40     private long chargeRemainingDuration;
41
42     @SerializedName("chargeRemainingEnergy")
43     private float chargeRemainingEnergy;
44
45     @SerializedName("chargedEnergy")
46     private float chargedEnergy;
47
48     @SerializedName("charging")
49     private boolean charging;
50
51     @SerializedName("connected")
52     private boolean connected;
53
54     @SerializedName("connectedDuration")
55     private long connectedDuration;
56
57     @SerializedName("enabled")
58     private boolean enabled;
59
60     @SerializedName("hasVehicle")
61     private boolean hasVehicle;
62
63     @SerializedName("loadpoint")
64     private int loadpoint;
65
66     @SerializedName("maxCurrent")
67     private float maxCurrent;
68
69     @SerializedName("minCurrent")
70     private float minCurrent;
71
72     @SerializedName("minSoc")
73     private float minSoC;
74
75     @SerializedName("mode")
76     private String mode;
77
78     @SerializedName("phases")
79     private int phases;
80
81     @SerializedName("pvAction")
82     private String pvAction;
83
84     @SerializedName("pvRemaining")
85     private long pvRemaining;
86
87     @SerializedName("targetSoc")
88     private float targetSoC;
89
90     @SerializedName("targetTime")
91     private String targetTime;
92
93     @SerializedName("title")
94     private String title;
95
96     @SerializedName("vehicleCapacity")
97     private float vehicleCapacity;
98
99     @SerializedName("vehicleOdometer")
100     private float vehicleOdometer;
101
102     @SerializedName("vehiclePresent")
103     private boolean vehiclePresent;
104
105     @SerializedName("vehicleRange")
106     private float vehicleRange;
107
108     @SerializedName("vehicleSoc")
109     private float vehicleSoC;
110
111     @SerializedName("vehicleTitle")
112     private String vehicleTitle;
113
114     /**
115      * @return number of active phases
116      */
117     public int getActivePhases() {
118         return activePhases;
119     }
120
121     /**
122      * @return charge current
123      */
124     public float getChargeCurrent() {
125         return chargeCurrent;
126     }
127
128     /**
129      * @return charge duration
130      */
131     public long getChargeDuration() {
132         return chargeDuration;
133     }
134
135     /**
136      * @return charge power
137      */
138     public float getChargePower() {
139         return chargePower;
140     }
141
142     /**
143      * @return charge remaining duration until the target SoC is reached
144      */
145     public long getChargeRemainingDuration() {
146         return chargeRemainingDuration;
147     }
148
149     /**
150      * @return charge remaining energy until the target SoC is reached
151      */
152     public float getChargeRemainingEnergy() {
153         return chargeRemainingEnergy;
154     }
155
156     /**
157      * @return charged energy
158      */
159     public float getChargedEnergy() {
160         return chargedEnergy;
161     }
162
163     /**
164      * @return whether loadpoint is charging a vehicle
165      */
166     public boolean getCharging() {
167         return charging;
168     }
169
170     /**
171      * @return whether a vehicle is connected to the loadpoint
172      */
173     public boolean getConnected() {
174         return connected;
175     }
176
177     /**
178      * @return vehicle connected duration
179      */
180     public long getConnectedDuration() {
181         return connectedDuration;
182     }
183
184     /**
185      * @return whether loadpoint is enabled
186      */
187     public boolean getEnabled() {
188         return enabled;
189     }
190
191     /**
192      * @return whether vehicle is configured for loadpoint
193      */
194     public boolean getHasVehicle() {
195         return hasVehicle;
196     }
197
198     /**
199      * @return loadpoint id
200      */
201     public int getLoadpoint() {
202         return loadpoint;
203     }
204
205     /**
206      * @return maximum current
207      */
208     public float getMaxCurrent() {
209         return maxCurrent;
210     }
211
212     /**
213      * @return minimum current
214      */
215     public float getMinCurrent() {
216         return minCurrent;
217     }
218
219     /**
220      * @return minimum state of charge
221      */
222     public float getMinSoC() {
223         return minSoC;
224     }
225
226     /**
227      * @return charging mode: off, now, minpv, pv
228      */
229     public String getMode() {
230         return mode;
231     }
232
233     /**
234      * @return number of enabled phases
235      */
236     public int getPhases() {
237         return phases;
238     }
239
240     /**
241      * @return the pv action
242      */
243     public String getPvAction() {
244         return pvAction;
245     }
246
247     /**
248      * @return the pv remaining
249      */
250     public long getPvRemaining() {
251         return pvRemaining;
252     }
253
254     /**
255      * @return target state of charge (SoC)
256      */
257     public float getTargetSoC() {
258         return targetSoC;
259     }
260
261     /**
262      * @return target time for the target state of charge
263      */
264     public String getTargetTime() {
265         return targetTime;
266     }
267
268     /**
269      * @return loadpoint's title/name
270      */
271     public String getTitle() {
272         return title;
273     }
274
275     /**
276      * @return vehicle's capacity
277      */
278     public float getVehicleCapacity() {
279         return vehicleCapacity;
280     }
281
282     /**
283      * @return vehicle's odometer
284      */
285     public float getVehicleOdometer() {
286         return vehicleOdometer;
287     }
288
289     /**
290      * @return whether evcc is able to get data from vehicle
291      */
292     public boolean getVehiclePresent() {
293         return vehiclePresent;
294     }
295
296     /**
297      * @return vehicle's range
298      */
299     public float getVehicleRange() {
300         return vehicleRange;
301     }
302
303     /**
304      * @return vehicle's state of charge (SoC)
305      */
306     public float getVehicleSoC() {
307         return vehicleSoC;
308     }
309
310     /**
311      * @return vehicle's title/name
312      */
313     public String getVehicleTitle() {
314         return vehicleTitle;
315     }
316 }