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("vehicleOdometer")
86 private float vehicleOdometer;
88 @SerializedName("vehiclePresent")
89 private boolean vehiclePresent;
91 @SerializedName("vehicleRange")
92 private float vehicleRange;
94 @SerializedName("vehicleSoc")
95 private float vehicleSoC;
97 @SerializedName("vehicleName")
98 private String vehicleName;
100 @SerializedName("effectiveLimitSoc")
101 private float effectiveLimitSoC;
103 @SerializedName("chargerFeatureHeating")
104 private boolean chargerFeatureHeating;
106 @SerializedName("chargerFeatureIntegratedDevice")
107 private boolean chargerFeatureIntegratedDevice;
110 * @return number of active phases
112 public int getActivePhases() {
117 * @return charge current
119 public float getChargeCurrent() {
120 return chargeCurrent;
124 * @return charge duration
126 public long getChargeDuration() {
127 return chargeDuration;
131 * @return charge power
133 public float getChargePower() {
138 * @return charge remaining duration until the target SoC is reached
140 public long getChargeRemainingDuration() {
141 return chargeRemainingDuration;
145 * @return charge remaining energy until the target SoC is reached
147 public float getChargeRemainingEnergy() {
148 return chargeRemainingEnergy;
152 * @return charged energy
154 public float getChargedEnergy() {
155 return chargedEnergy;
159 * @return whether loadpoint is charging a vehicle
161 public boolean getCharging() {
166 * @return whether a vehicle is connected to the loadpoint
168 public boolean getConnected() {
173 * @return vehicle connected duration
175 public long getConnectedDuration() {
176 return connectedDuration;
180 * @return whether loadpoint is enabled
182 public boolean getEnabled() {
187 * @return maximum current
189 public float getMaxCurrent() {
194 * @return minimum current
196 public float getMinCurrent() {
201 * @return charging mode: off, now, minpv, pv
203 public String getMode() {
208 * @return number of enabled phases
210 public int getPhases() {
215 * @return limit energy
217 public float getLimitEnergy() {
222 * @return limit state of charge (SoC)
224 public float getLimitSoC() {
229 * @return target time for the target state of charge
231 public String getTargetTime() {
236 * @return loadpoint's title/name
238 public String getTitle() {
243 * @return vehicle's odometer
245 public float getVehicleOdometer() {
246 return vehicleOdometer;
250 * @return whether evcc is able to get data from vehicle
252 public boolean getVehiclePresent() {
253 return vehiclePresent;
257 * @return vehicle's range
259 public float getVehicleRange() {
264 * @return vehicle's state of charge (SoC)
266 public float getVehicleSoC() {
271 * @return vehicle's title/name
273 public String getVehicleName() {
278 * @return effective limit state of charge
280 public float getEffectiveLimitSoC() {
281 return effectiveLimitSoC;
285 * @return Charger Feature: Heating
287 public boolean getChargerFeatureHeating() {
288 return chargerFeatureHeating;
292 * @return Charger Feature: Integrated Device
294 public boolean getChargerFeatureIntegratedDevice() {
295 return chargerFeatureIntegratedDevice;