]> git.basschouten.com Git - openhab-addons.git/blob
66227620b2fd4ed06b4d6a6e6a31d0a9ef1c251b
[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 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.117.0
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("maxCurrent")
61     private float maxCurrent;
62
63     @SerializedName("minCurrent")
64     private float minCurrent;
65
66     @SerializedName("minSoc")
67     private float minSoC;
68
69     @SerializedName("mode")
70     private String mode;
71
72     @SerializedName("phasesEnabled")
73     private int phases;
74
75     @SerializedName("planActive")
76     private boolean planActive;
77
78     @SerializedName("targetEnergy")
79     private float targetEnergy;
80
81     @SerializedName("targetSoc")
82     private float targetSoC;
83
84     @SerializedName("targetTime")
85     private String targetTime;
86
87     @SerializedName("title")
88     private String title;
89
90     @SerializedName("vehicleCapacity")
91     private float vehicleCapacity;
92
93     @SerializedName("vehicleOdometer")
94     private float vehicleOdometer;
95
96     @SerializedName("vehiclePresent")
97     private boolean vehiclePresent;
98
99     @SerializedName("vehicleRange")
100     private float vehicleRange;
101
102     @SerializedName("vehicleSoc")
103     private float vehicleSoC;
104
105     @SerializedName("vehicleTitle")
106     private String vehicleTitle;
107
108     /**
109      * @return number of active phases
110      */
111     public int getActivePhases() {
112         return activePhases;
113     }
114
115     /**
116      * @return charge current
117      */
118     public float getChargeCurrent() {
119         return chargeCurrent;
120     }
121
122     /**
123      * @return charge duration
124      */
125     public long getChargeDuration() {
126         return chargeDuration;
127     }
128
129     /**
130      * @return charge power
131      */
132     public float getChargePower() {
133         return chargePower;
134     }
135
136     /**
137      * @return charge remaining duration until the target SoC is reached
138      */
139     public long getChargeRemainingDuration() {
140         return chargeRemainingDuration;
141     }
142
143     /**
144      * @return charge remaining energy until the target SoC is reached
145      */
146     public float getChargeRemainingEnergy() {
147         return chargeRemainingEnergy;
148     }
149
150     /**
151      * @return charged energy
152      */
153     public float getChargedEnergy() {
154         return chargedEnergy;
155     }
156
157     /**
158      * @return whether loadpoint is charging a vehicle
159      */
160     public boolean getCharging() {
161         return charging;
162     }
163
164     /**
165      * @return whether a vehicle is connected to the loadpoint
166      */
167     public boolean getConnected() {
168         return connected;
169     }
170
171     /**
172      * @return vehicle connected duration
173      */
174     public long getConnectedDuration() {
175         return connectedDuration;
176     }
177
178     /**
179      * @return whether loadpoint is enabled
180      */
181     public boolean getEnabled() {
182         return enabled;
183     }
184
185     /**
186      * @return maximum current
187      */
188     public float getMaxCurrent() {
189         return maxCurrent;
190     }
191
192     /**
193      * @return minimum current
194      */
195     public float getMinCurrent() {
196         return minCurrent;
197     }
198
199     /**
200      * @return minimum state of charge
201      */
202     public float getMinSoC() {
203         return minSoC;
204     }
205
206     /**
207      * @return charging mode: off, now, minpv, pv
208      */
209     public String getMode() {
210         return mode;
211     }
212
213     /**
214      * @return number of enabled phases
215      */
216     public int getPhases() {
217         return phases;
218     }
219
220     /**
221      * @return whether charging plan is active
222      */
223     public boolean getPlanActive() {
224         return planActive;
225     }
226
227     /**
228      * @return target energy
229      */
230     public float getTargetEnergy() {
231         return targetEnergy;
232     }
233
234     /**
235      * @return target state of charge (SoC)
236      */
237     public float getTargetSoC() {
238         return targetSoC;
239     }
240
241     /**
242      * @return target time for the target state of charge
243      */
244     public String getTargetTime() {
245         return targetTime;
246     }
247
248     /**
249      * @return loadpoint's title/name
250      */
251     public String getTitle() {
252         return title;
253     }
254
255     /**
256      * @return vehicle's capacity
257      */
258     public float getVehicleCapacity() {
259         return vehicleCapacity;
260     }
261
262     /**
263      * @return vehicle's odometer
264      */
265     public float getVehicleOdometer() {
266         return vehicleOdometer;
267     }
268
269     /**
270      * @return whether evcc is able to get data from vehicle
271      */
272     public boolean getVehiclePresent() {
273         return vehiclePresent;
274     }
275
276     /**
277      * @return vehicle's range
278      */
279     public float getVehicleRange() {
280         return vehicleRange;
281     }
282
283     /**
284      * @return vehicle's state of charge (SoC)
285      */
286     public float getVehicleSoC() {
287         return vehicleSoC;
288     }
289
290     /**
291      * @return vehicle's title/name
292      */
293     public String getVehicleTitle() {
294         return vehicleTitle;
295     }
296 }