]> git.basschouten.com Git - openhab-addons.git/blob
6049c50c83e116fa1001a4570507374b3983f682
[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     @SerializedName("effectiveLimitSoc")
104     private float effectiveLimitSoC;
105
106     @SerializedName("chargerFeatureHeating")
107     private boolean chargerFeatureHeating;
108
109     @SerializedName("chargerFeatureIntegratedDevice")
110     private boolean chargerFeatureIntegratedDevice;
111
112     /**
113      * @return number of active phases
114      */
115     public int getActivePhases() {
116         return activePhases;
117     }
118
119     /**
120      * @return charge current
121      */
122     public float getChargeCurrent() {
123         return chargeCurrent;
124     }
125
126     /**
127      * @return charge duration
128      */
129     public long getChargeDuration() {
130         return chargeDuration;
131     }
132
133     /**
134      * @return charge power
135      */
136     public float getChargePower() {
137         return chargePower;
138     }
139
140     /**
141      * @return charge remaining duration until the target SoC is reached
142      */
143     public long getChargeRemainingDuration() {
144         return chargeRemainingDuration;
145     }
146
147     /**
148      * @return charge remaining energy until the target SoC is reached
149      */
150     public float getChargeRemainingEnergy() {
151         return chargeRemainingEnergy;
152     }
153
154     /**
155      * @return charged energy
156      */
157     public float getChargedEnergy() {
158         return chargedEnergy;
159     }
160
161     /**
162      * @return whether loadpoint is charging a vehicle
163      */
164     public boolean getCharging() {
165         return charging;
166     }
167
168     /**
169      * @return whether a vehicle is connected to the loadpoint
170      */
171     public boolean getConnected() {
172         return connected;
173     }
174
175     /**
176      * @return vehicle connected duration
177      */
178     public long getConnectedDuration() {
179         return connectedDuration;
180     }
181
182     /**
183      * @return whether loadpoint is enabled
184      */
185     public boolean getEnabled() {
186         return enabled;
187     }
188
189     /**
190      * @return maximum current
191      */
192     public float getMaxCurrent() {
193         return maxCurrent;
194     }
195
196     /**
197      * @return minimum current
198      */
199     public float getMinCurrent() {
200         return minCurrent;
201     }
202
203     /**
204      * @return charging mode: off, now, minpv, pv
205      */
206     public String getMode() {
207         return mode;
208     }
209
210     /**
211      * @return number of enabled phases
212      */
213     public int getPhases() {
214         return phases;
215     }
216
217     /**
218      * @return limit energy
219      */
220     public float getLimitEnergy() {
221         return limitEnergy;
222     }
223
224     /**
225      * @return limit state of charge (SoC)
226      */
227     public float getLimitSoC() {
228         return limitSoC;
229     }
230
231     /**
232      * @return target time for the target state of charge
233      */
234     public String getTargetTime() {
235         return targetTime;
236     }
237
238     /**
239      * @return loadpoint's title/name
240      */
241     public String getTitle() {
242         return title;
243     }
244
245     /**
246      * @return vehicle's capacity
247      */
248     public float getVehicleCapacity() {
249         return vehicleCapacity;
250     }
251
252     /**
253      * @return vehicle's odometer
254      */
255     public float getVehicleOdometer() {
256         return vehicleOdometer;
257     }
258
259     /**
260      * @return whether evcc is able to get data from vehicle
261      */
262     public boolean getVehiclePresent() {
263         return vehiclePresent;
264     }
265
266     /**
267      * @return vehicle's range
268      */
269     public float getVehicleRange() {
270         return vehicleRange;
271     }
272
273     /**
274      * @return vehicle's state of charge (SoC)
275      */
276     public float getVehicleSoC() {
277         return vehicleSoC;
278     }
279
280     /**
281      * @return vehicle's title/name
282      */
283     public String getVehicleName() {
284         return vehicleName;
285     }
286
287     /**
288      * @return effective limit state of charge
289      */
290     public float getEffectiveLimitSoC() {
291         return effectiveLimitSoC;
292     }
293
294     /**
295      * @return Charger Feature: Heating
296      */
297     public boolean getChargerFeatureHeating() {
298         return chargerFeatureHeating;
299     }
300
301     /**
302      * @return Charger Feature: Integrated Device
303      */
304     public boolean getChargerFeatureIntegratedDevice() {
305         return chargerFeatureIntegratedDevice;
306     }
307 }