diff --git a/bundles/org.openhab.binding.energidataservice/src/main/java/org/openhab/binding/energidataservice/internal/handler/EnergiDataServiceHandler.java b/bundles/org.openhab.binding.energidataservice/src/main/java/org/openhab/binding/energidataservice/internal/handler/EnergiDataServiceHandler.java index 3386ecd52e5..b1fc9fdf433 100644 --- a/bundles/org.openhab.binding.energidataservice/src/main/java/org/openhab/binding/energidataservice/internal/handler/EnergiDataServiceHandler.java +++ b/bundles/org.openhab.binding.energidataservice/src/main/java/org/openhab/binding/energidataservice/internal/handler/EnergiDataServiceHandler.java @@ -381,6 +381,7 @@ public class EnergiDataServiceHandler extends BaseThingHandler { private void updateTimeSeries() { TimeSeries spotPriceTimeSeries = new TimeSeries(REPLACE); Map datahubTimeSeriesMap = new HashMap<>(); + Map datahubPreviousTariff = new HashMap<>(); for (DatahubTariff datahubTariff : DatahubTariff.values()) { datahubTimeSeriesMap.put(datahubTariff, new TimeSeries(REPLACE)); } @@ -401,8 +402,14 @@ public class EnergiDataServiceHandler extends BaseThingHandler { } BigDecimal tariff = cacheManager.getTariff(datahubTariff, hourStart); if (tariff != null) { + BigDecimal previousTariff = datahubPreviousTariff.get(datahubTariff); + if (previousTariff != null && tariff.equals(previousTariff)) { + // Skip redundant states. + continue; + } TimeSeries timeSeries = entry.getValue(); timeSeries.add(hourStart, getEnergyPrice(tariff, CURRENCY_DKK)); + datahubPreviousTariff.put(datahubTariff, tariff); } } }