diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java index 8507ad5f4fa..75a2f0aca06 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/GroupStateTriggerHandler.java @@ -29,7 +29,7 @@ import org.openhab.core.items.events.ItemAddedEvent; import org.openhab.core.items.events.ItemRemovedEvent; import org.openhab.core.items.events.ItemStateChangedEvent; -import org.openhab.core.items.events.ItemStateEvent; +import org.openhab.core.items.events.ItemStateUpdatedEvent; import org.openhab.core.types.State; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; @@ -72,7 +72,7 @@ public GroupStateTriggerHandler(Trigger module, String ruleUID, BundleContext bu this.state = (String) module.getConfiguration().get(CFG_STATE); this.previousState = (String) module.getConfiguration().get(CFG_PREVIOUS_STATE); if (UPDATE_MODULE_TYPE_ID.equals(module.getTypeUID())) { - this.types = Set.of(ItemStateEvent.TYPE, ItemAddedEvent.TYPE, ItemRemovedEvent.TYPE); + this.types = Set.of(ItemStateUpdatedEvent.TYPE, ItemAddedEvent.TYPE, ItemRemovedEvent.TYPE); } else { this.types = Set.of(ItemStateChangedEvent.TYPE, GroupItemStateChangedEvent.TYPE, ItemAddedEvent.TYPE, ItemRemovedEvent.TYPE); @@ -113,8 +113,8 @@ public void receive(Event event) { TriggerHandlerCallback cb = (TriggerHandlerCallback) callback; logger.trace("Received Event: Source: {} Topic: {} Type: {} Payload: {}", event.getSource(), event.getTopic(), event.getType(), event.getPayload()); - if (event instanceof ItemStateEvent && UPDATE_MODULE_TYPE_ID.equals(module.getTypeUID())) { - ItemStateEvent isEvent = (ItemStateEvent) event; + if (event instanceof ItemStateUpdatedEvent && UPDATE_MODULE_TYPE_ID.equals(module.getTypeUID())) { + ItemStateUpdatedEvent isEvent = (ItemStateUpdatedEvent) event; String itemName = isEvent.getItemName(); Item item = itemRegistry.get(itemName); if (item != null && item.getGroupNames().contains(groupName)) { diff --git a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java index c931b4ca6ec..15b4d0a572f 100644 --- a/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java +++ b/bundles/org.openhab.core.automation/src/main/java/org/openhab/core/automation/internal/module/handler/ItemStateTriggerHandler.java @@ -28,6 +28,7 @@ import org.openhab.core.events.TopicPrefixEventFilter; import org.openhab.core.items.ItemRegistry; import org.openhab.core.items.events.GroupItemStateChangedEvent; +import org.openhab.core.items.events.GroupStateUpdatedEvent; import org.openhab.core.items.events.ItemAddedEvent; import org.openhab.core.items.events.ItemRemovedEvent; import org.openhab.core.items.events.ItemStateChangedEvent; @@ -77,7 +78,8 @@ public ItemStateTriggerHandler(Trigger module, String ruleUID, BundleContext bun this.previousState = (String) module.getConfiguration().get(CFG_PREVIOUS_STATE); this.ruleUID = ruleUID; if (UPDATE_MODULE_TYPE_ID.equals(module.getTypeUID())) { - this.types = Set.of(ItemStateUpdatedEvent.TYPE, ItemAddedEvent.TYPE, ItemRemovedEvent.TYPE); + this.types = Set.of(ItemStateUpdatedEvent.TYPE, GroupStateUpdatedEvent.TYPE, ItemAddedEvent.TYPE, + ItemRemovedEvent.TYPE); } else { this.types = Set.of(ItemStateChangedEvent.TYPE, GroupItemStateChangedEvent.TYPE, ItemAddedEvent.TYPE, ItemRemovedEvent.TYPE);