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;
103 @SerializedName("effectiveLimitSoc")
104 private float effectiveLimitSoC;
106 @SerializedName("chargerFeatureHeating")
107 private boolean chargerFeatureHeating;
109 @SerializedName("chargerFeatureIntegratedDevice")
110 private boolean chargerFeatureIntegratedDevice;
113 * @return number of active phases
115 public int getActivePhases() {
120 * @return charge current
122 public float getChargeCurrent() {
123 return chargeCurrent;
127 * @return charge duration
129 public long getChargeDuration() {
130 return chargeDuration;
134 * @return charge power
136 public float getChargePower() {
141 * @return charge remaining duration until the target SoC is reached
143 public long getChargeRemainingDuration() {
144 return chargeRemainingDuration;
148 * @return charge remaining energy until the target SoC is reached
150 public float getChargeRemainingEnergy() {
151 return chargeRemainingEnergy;
155 * @return charged energy
157 public float getChargedEnergy() {
158 return chargedEnergy;
162 * @return whether loadpoint is charging a vehicle
164 public boolean getCharging() {
169 * @return whether a vehicle is connected to the loadpoint
171 public boolean getConnected() {
176 * @return vehicle connected duration
178 public long getConnectedDuration() {
179 return connectedDuration;
183 * @return whether loadpoint is enabled
185 public boolean getEnabled() {
190 * @return maximum current
192 public float getMaxCurrent() {
197 * @return minimum current
199 public float getMinCurrent() {
204 * @return charging mode: off, now, minpv, pv
206 public String getMode() {
211 * @return number of enabled phases
213 public int getPhases() {
218 * @return limit energy
220 public float getLimitEnergy() {
225 * @return limit state of charge (SoC)
227 public float getLimitSoC() {
232 * @return target time for the target state of charge
234 public String getTargetTime() {
239 * @return loadpoint's title/name
241 public String getTitle() {
246 * @return vehicle's capacity
248 public float getVehicleCapacity() {
249 return vehicleCapacity;
253 * @return vehicle's odometer
255 public float getVehicleOdometer() {
256 return vehicleOdometer;
260 * @return whether evcc is able to get data from vehicle
262 public boolean getVehiclePresent() {
263 return vehiclePresent;
267 * @return vehicle's range
269 public float getVehicleRange() {
274 * @return vehicle's state of charge (SoC)
276 public float getVehicleSoC() {
281 * @return vehicle's title/name
283 public String getVehicleName() {
288 * @return effective limit state of charge
290 public float getEffectiveLimitSoC() {
291 return effectiveLimitSoC;
295 * @return Charger Feature: Heating
297 public boolean getChargerFeatureHeating() {
298 return chargerFeatureHeating;
302 * @return Charger Feature: Integrated Device
304 public boolean getChargerFeatureIntegratedDevice() {
305 return chargerFeatureIntegratedDevice;