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