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