2 * Copyright (c) 2010-2023 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.111.1
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("hasVehicle")
61 private boolean hasVehicle;
63 @SerializedName("loadpoint")
64 private int loadpoint;
66 @SerializedName("maxCurrent")
67 private float maxCurrent;
69 @SerializedName("minCurrent")
70 private float minCurrent;
72 @SerializedName("minSoc")
75 @SerializedName("mode")
78 @SerializedName("phases")
81 @SerializedName("pvAction")
82 private String pvAction;
84 @SerializedName("pvRemaining")
85 private long pvRemaining;
87 @SerializedName("targetSoc")
88 private float targetSoC;
90 @SerializedName("targetTime")
91 private String targetTime;
93 @SerializedName("title")
96 @SerializedName("vehicleCapacity")
97 private float vehicleCapacity;
99 @SerializedName("vehicleOdometer")
100 private float vehicleOdometer;
102 @SerializedName("vehiclePresent")
103 private boolean vehiclePresent;
105 @SerializedName("vehicleRange")
106 private float vehicleRange;
108 @SerializedName("vehicleSoc")
109 private float vehicleSoC;
111 @SerializedName("vehicleTitle")
112 private String vehicleTitle;
115 * @return number of active phases
117 public int getActivePhases() {
122 * @return charge current
124 public float getChargeCurrent() {
125 return chargeCurrent;
129 * @return charge duration
131 public long getChargeDuration() {
132 return chargeDuration;
136 * @return charge power
138 public float getChargePower() {
143 * @return charge remaining duration until the target SoC is reached
145 public long getChargeRemainingDuration() {
146 return chargeRemainingDuration;
150 * @return charge remaining energy until the target SoC is reached
152 public float getChargeRemainingEnergy() {
153 return chargeRemainingEnergy;
157 * @return charged energy
159 public float getChargedEnergy() {
160 return chargedEnergy;
164 * @return whether loadpoint is charging a vehicle
166 public boolean getCharging() {
171 * @return whether a vehicle is connected to the loadpoint
173 public boolean getConnected() {
178 * @return vehicle connected duration
180 public long getConnectedDuration() {
181 return connectedDuration;
185 * @return whether loadpoint is enabled
187 public boolean getEnabled() {
192 * @return whether vehicle is configured for loadpoint
194 public boolean getHasVehicle() {
199 * @return loadpoint id
201 public int getLoadpoint() {
206 * @return maximum current
208 public float getMaxCurrent() {
213 * @return minimum current
215 public float getMinCurrent() {
220 * @return minimum state of charge
222 public float getMinSoC() {
227 * @return charging mode: off, now, minpv, pv
229 public String getMode() {
234 * @return number of enabled phases
236 public int getPhases() {
241 * @return the pv action
243 public String getPvAction() {
248 * @return the pv remaining
250 public long getPvRemaining() {
255 * @return target state of charge (SoC)
257 public float getTargetSoC() {
262 * @return target time for the target state of charge
264 public String getTargetTime() {
269 * @return loadpoint's title/name
271 public String getTitle() {
276 * @return vehicle's capacity
278 public float getVehicleCapacity() {
279 return vehicleCapacity;
283 * @return vehicle's odometer
285 public float getVehicleOdometer() {
286 return vehicleOdometer;
290 * @return whether evcc is able to get data from vehicle
292 public boolean getVehiclePresent() {
293 return vehiclePresent;
297 * @return vehicle's range
299 public float getVehicleRange() {
304 * @return vehicle's state of charge (SoC)
306 public float getVehicleSoC() {
311 * @return vehicle's title/name
313 public String getVehicleTitle() {