diff --git a/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/EvccAPI.java b/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/EvccAPI.java index f658f23869b99..afacdfe0be646 100644 --- a/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/EvccAPI.java +++ b/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/EvccAPI.java @@ -75,6 +75,7 @@ private String httpRequest(String url, String method) throws EvccApiException { */ public Result getResult() throws EvccApiException { final String response = httpRequest(this.host + EVCC_REST_API + "state", "GET"); + logger.trace("API Response >> {}", response); try { Status status = gson.fromJson(response, Status.class); if (status == null) { diff --git a/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Loadpoint.java b/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Loadpoint.java index 3792e43ce5b1e..6b9a6f79d89d3 100644 --- a/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Loadpoint.java +++ b/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Loadpoint.java @@ -271,7 +271,7 @@ public float getVehicleSoC() { * @return vehicle's title/name */ public String getVehicleName() { - return vehicleName; + return vehicleName != null ? vehicleName.replace(":", "-") : vehicleName; } /** diff --git a/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Result.java b/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Result.java index 598ee3f702888..4da0060bd8133 100644 --- a/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Result.java +++ b/bundles/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Result.java @@ -12,7 +12,9 @@ */ package org.openhab.binding.evcc.internal.api.dto; +import java.util.HashMap; import java.util.Map; +import java.util.Map.Entry; import com.google.gson.annotations.SerializedName; @@ -219,7 +221,12 @@ public String getSiteTitle() { } public Map getVehicles() { - return vehicles; + Map correctedMap = new HashMap<>(); + for (Entry entry : vehicles.entrySet()) { + // The key from the vehicles map is used as uid, so it should not contain semicolons. + correctedMap.put(entry.getKey().replace(":", "-"), entry.getValue()); + } + return correctedMap; } /**