Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ private void stopOptimisation(String assetId) {
if (scheduledFuture != null) {
scheduledFuture.cancel(false);
}

services.getAssetPredictedDatapointService().purgeValues(assetId, EmsEnergyOptimisationAsset.POWER_LIMIT_MAXIMUM_PROFILE_MANUAL.getName());
services.getAssetPredictedDatapointService().purgeValues(assetId, EmsEnergyOptimisationAsset.POWER_LIMIT_MINIMUM_PROFILE_MANUAL.getName());
services.getAssetPredictedDatapointService().purgeValues(assetId, EmsEnergyOptimisationAsset.POWER_LIMIT_MAXIMUM_PROFILE_TOTAL.getName());
services.getAssetPredictedDatapointService().purgeValues(assetId, EmsEnergyOptimisationAsset.POWER_LIMIT_MINIMUM_PROFILE_TOTAL.getName());
}

private void startGopacsHandler(String contractedEan, String realm, String assetId) {
Expand Down Expand Up @@ -426,6 +431,11 @@ private void processAttributeEventEmsEnergyOptimisationAsset(AttributeEvent attr

// Update power limit maximum profile manual
if (attributeName.equals(EmsEnergyOptimisationAsset.POWER_LIMIT_MAXIMUM_PROFILE_MANUAL_INPUT.getName())) {
if (!energyOptimisationAssetsMap.containsKey(assetId)) {
LOG.warning(String.format("%s; Optimisation is disabled. The manual power limit profile has been updated but has not been loaded into the forecast database.", logPrefix));
return;
}

String powerLimitMaximumProfileManualInput = (String) attributeEvent.getValue().orElse("");

if (powerLimitMaximumProfileManualInput.isBlank()) {
Expand Down Expand Up @@ -463,6 +473,11 @@ private void processAttributeEventEmsEnergyOptimisationAsset(AttributeEvent attr

// Update power limit minimum profile manual
if (attributeName.equals(EmsEnergyOptimisationAsset.POWER_LIMIT_MINIMUM_PROFILE_MANUAL_INPUT.getName())) {
if (!energyOptimisationAssetsMap.containsKey(assetId)) {
LOG.warning(String.format("%s; Optimisation is disabled. The manual power limit profile has been updated but has not been loaded into the forecast database.", logPrefix));
return;
}

String powerLimitMinimumProfileManualInput = (String) attributeEvent.getValue().orElse("");

if (powerLimitMinimumProfileManualInput.isBlank()) {
Expand Down
Loading