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.123.1
21 * @author Florian Hotze - Initial contribution
22 * @author Luca Arnecke - Update to evcc version 0.123.1
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
28 @SerializedName("phasesActive")
29 private int activePhases;
31 @SerializedName("chargeCurrent")
32 private float chargeCurrent;
34 @SerializedName("chargeDuration")
35 private long chargeDuration;
37 @SerializedName("chargePower")
38 private float chargePower;
40 @SerializedName("chargeRemainingDuration")
41 private long chargeRemainingDuration;
43 @SerializedName("chargeRemainingEnergy")
44 private float chargeRemainingEnergy;
46 @SerializedName("chargedEnergy")
47 private float chargedEnergy;
49 @SerializedName("charging")
50 private boolean charging;
52 @SerializedName("connected")
53 private boolean connected;
55 @SerializedName("connectedDuration")
56 private long connectedDuration;
58 @SerializedName("enabled")
59 private boolean enabled;
61 @SerializedName("maxCurrent")
62 private float maxCurrent;
64 @SerializedName("minCurrent")
65 private float minCurrent;
67 @SerializedName("mode")
70 @SerializedName("phasesEnabled")
73 @SerializedName("limitEnergy")
74 private float limitEnergy;
76 @SerializedName("limitSoc")
77 private float limitSoC;
79 @SerializedName("targetTime")
80 private String targetTime;
82 @SerializedName("title")
85 @SerializedName("vehicleCapacity")
86 private float vehicleCapacity;
88 @SerializedName("vehicleOdometer")
89 private float vehicleOdometer;
91 @SerializedName("vehiclePresent")
92 private boolean vehiclePresent;
94 @SerializedName("vehicleRange")
95 private float vehicleRange;
97 @SerializedName("vehicleSoc")
98 private float vehicleSoC;
100 @SerializedName("vehicleName")
101 private String vehicleName;
104 * @return number of active phases
106 public int getActivePhases() {
111 * @return charge current
113 public float getChargeCurrent() {
114 return chargeCurrent;
118 * @return charge duration
120 public long getChargeDuration() {
121 return chargeDuration;
125 * @return charge power
127 public float getChargePower() {
132 * @return charge remaining duration until the target SoC is reached
134 public long getChargeRemainingDuration() {
135 return chargeRemainingDuration;
139 * @return charge remaining energy until the target SoC is reached
141 public float getChargeRemainingEnergy() {
142 return chargeRemainingEnergy;
146 * @return charged energy
148 public float getChargedEnergy() {
149 return chargedEnergy;
153 * @return whether loadpoint is charging a vehicle
155 public boolean getCharging() {
160 * @return whether a vehicle is connected to the loadpoint
162 public boolean getConnected() {
167 * @return vehicle connected duration
169 public long getConnectedDuration() {
170 return connectedDuration;
174 * @return whether loadpoint is enabled
176 public boolean getEnabled() {
181 * @return maximum current
183 public float getMaxCurrent() {
188 * @return minimum current
190 public float getMinCurrent() {
195 * @return charging mode: off, now, minpv, pv
197 public String getMode() {
202 * @return number of enabled phases
204 public int getPhases() {
209 * @return limit energy
211 public float getLimitEnergy() {
216 * @return limit state of charge (SoC)
218 public float getLimitSoC() {
223 * @return target time for the target state of charge
225 public String getTargetTime() {
230 * @return loadpoint's title/name
232 public String getTitle() {
237 * @return vehicle's capacity
239 public float getVehicleCapacity() {
240 return vehicleCapacity;
244 * @return vehicle's odometer
246 public float getVehicleOdometer() {
247 return vehicleOdometer;
251 * @return whether evcc is able to get data from vehicle
253 public boolean getVehiclePresent() {
254 return vehiclePresent;
258 * @return vehicle's range
260 public float getVehicleRange() {
265 * @return vehicle's state of charge (SoC)
267 public float getVehicleSoC() {
272 * @return vehicle's title/name
274 public String getVehicleName() {