2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.evcc.internal.api.dto;
15 import com.google.gson.annotations.SerializedName;
18 * This class represents a loadpoint object of the status response (/api/state).
19 * This DTO was written for evcc version 0.117.0
21 * @author Florian Hotze - Initial contribution
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
27 @SerializedName("phasesActive")
28 private int activePhases;
30 @SerializedName("chargeCurrent")
31 private float chargeCurrent;
33 @SerializedName("chargeDuration")
34 private long chargeDuration;
36 @SerializedName("chargePower")
37 private float chargePower;
39 @SerializedName("chargeRemainingDuration")
40 private long chargeRemainingDuration;
42 @SerializedName("chargeRemainingEnergy")
43 private float chargeRemainingEnergy;
45 @SerializedName("chargedEnergy")
46 private float chargedEnergy;
48 @SerializedName("charging")
49 private boolean charging;
51 @SerializedName("connected")
52 private boolean connected;
54 @SerializedName("connectedDuration")
55 private long connectedDuration;
57 @SerializedName("enabled")
58 private boolean enabled;
60 @SerializedName("maxCurrent")
61 private float maxCurrent;
63 @SerializedName("minCurrent")
64 private float minCurrent;
66 @SerializedName("minSoc")
69 @SerializedName("mode")
72 @SerializedName("phasesEnabled")
75 @SerializedName("planActive")
76 private boolean planActive;
78 @SerializedName("targetEnergy")
79 private float targetEnergy;
81 @SerializedName("targetSoc")
82 private float targetSoC;
84 @SerializedName("targetTime")
85 private String targetTime;
87 @SerializedName("title")
90 @SerializedName("vehicleCapacity")
91 private float vehicleCapacity;
93 @SerializedName("vehicleOdometer")
94 private float vehicleOdometer;
96 @SerializedName("vehiclePresent")
97 private boolean vehiclePresent;
99 @SerializedName("vehicleRange")
100 private float vehicleRange;
102 @SerializedName("vehicleSoc")
103 private float vehicleSoC;
105 @SerializedName("vehicleTitle")
106 private String vehicleTitle;
109 * @return number of active phases
111 public int getActivePhases() {
116 * @return charge current
118 public float getChargeCurrent() {
119 return chargeCurrent;
123 * @return charge duration
125 public long getChargeDuration() {
126 return chargeDuration;
130 * @return charge power
132 public float getChargePower() {
137 * @return charge remaining duration until the target SoC is reached
139 public long getChargeRemainingDuration() {
140 return chargeRemainingDuration;
144 * @return charge remaining energy until the target SoC is reached
146 public float getChargeRemainingEnergy() {
147 return chargeRemainingEnergy;
151 * @return charged energy
153 public float getChargedEnergy() {
154 return chargedEnergy;
158 * @return whether loadpoint is charging a vehicle
160 public boolean getCharging() {
165 * @return whether a vehicle is connected to the loadpoint
167 public boolean getConnected() {
172 * @return vehicle connected duration
174 public long getConnectedDuration() {
175 return connectedDuration;
179 * @return whether loadpoint is enabled
181 public boolean getEnabled() {
186 * @return maximum current
188 public float getMaxCurrent() {
193 * @return minimum current
195 public float getMinCurrent() {
200 * @return minimum state of charge
202 public float getMinSoC() {
207 * @return charging mode: off, now, minpv, pv
209 public String getMode() {
214 * @return number of enabled phases
216 public int getPhases() {
221 * @return whether charging plan is active
223 public boolean getPlanActive() {
228 * @return target energy
230 public float getTargetEnergy() {
235 * @return target state of charge (SoC)
237 public float getTargetSoC() {
242 * @return target time for the target state of charge
244 public String getTargetTime() {
249 * @return loadpoint's title/name
251 public String getTitle() {
256 * @return vehicle's capacity
258 public float getVehicleCapacity() {
259 return vehicleCapacity;
263 * @return vehicle's odometer
265 public float getVehicleOdometer() {
266 return vehicleOdometer;
270 * @return whether evcc is able to get data from vehicle
272 public boolean getVehiclePresent() {
273 return vehiclePresent;
277 * @return vehicle's range
279 public float getVehicleRange() {
284 * @return vehicle's state of charge (SoC)
286 public float getVehicleSoC() {
291 * @return vehicle's title/name
293 public String getVehicleTitle() {