Search in sources :

Example 21 with Action

use of org.openhab.core.automation.Action in project openhab-core by openhab.

the class RuleEventTest method testRuleEvents.

@Test
public void testRuleEvents() throws ItemNotFoundException {
    // Registering eventSubscriber
    List<Event> ruleEvents = new ArrayList<>();
    EventSubscriber ruleEventHandler = new EventSubscriber() {

        @Override
        public Set<String> getSubscribedEventTypes() {
            return Set.of(RuleAddedEvent.TYPE, RuleRemovedEvent.TYPE, RuleStatusInfoEvent.TYPE, RuleUpdatedEvent.TYPE);
        }

        @Override
        @Nullable
        public EventFilter getEventFilter() {
            return null;
        }

        @Override
        public void receive(Event event) {
            logger.info("RuleEvent: {}", event.getTopic());
            ruleEvents.add(event);
        }
    };
    registerService(ruleEventHandler);
    // Creation of RULE
    Configuration triggerConfig = new Configuration(Map.ofEntries(entry("eventSource", "myMotionItem2"), entry("eventTopic", "openhab/*"), entry("eventTypes", "ItemStateEvent")));
    Configuration actionConfig = new Configuration(Map.ofEntries(entry("itemName", "myLampItem2"), entry("command", "ON")));
    List<Trigger> triggers = List.of(ModuleBuilder.createTrigger().withId("ItemStateChangeTrigger2").withTypeUID("core.GenericEventTrigger").withConfiguration(triggerConfig).build());
    List<Action> actions = List.of(ModuleBuilder.createAction().withId("ItemPostCommandAction2").withTypeUID("core.ItemCommandAction").withConfiguration(actionConfig).build());
    Rule rule = RuleBuilder.create("myRule21").withTriggers(triggers).withActions(actions).withName("RuleEventTestingRule").build();
    logger.info("Rule created: {}", rule.getUID());
    RuleRegistry ruleRegistry = getService(RuleRegistry.class);
    RuleManager ruleEngine = getService(RuleManager.class);
    ruleRegistry.add(rule);
    ruleEngine.setEnabled(rule.getUID(), true);
    waitForAssert(() -> {
        assertThat(ruleEngine.getStatusInfo(rule.getUID()).getStatus(), is(RuleStatus.IDLE));
    });
    // TEST RULE
    EventPublisher eventPublisher = getService(EventPublisher.class);
    ItemRegistry itemRegistry = getService(ItemRegistry.class);
    SwitchItem myMotionItem = (SwitchItem) itemRegistry.getItem("myMotionItem2");
    assertNotNull(myMotionItem);
    eventPublisher.post(ItemEventFactory.createStateEvent("myPresenceItem2", OnOffType.ON));
    EventSubscriber itemEventHandler = new EventSubscriber() {

        @Override
        public void receive(Event event) {
            logger.info("Event: {}", event.getTopic());
            if (event instanceof ItemCommandEvent && event.getTopic().contains("myLampItem2")) {
                itemEvent = event;
            }
        }

        @Override
        public Set<String> getSubscribedEventTypes() {
            return Set.of(ItemCommandEvent.TYPE);
        }

        @Override
        @Nullable
        public EventFilter getEventFilter() {
            return null;
        }
    };
    registerService(itemEventHandler);
    eventPublisher.post(ItemEventFactory.createStateEvent("myMotionItem2", OnOffType.ON));
    waitForAssert(() -> assertThat(itemEvent, is(notNullValue())));
    assertThat(itemEvent.getTopic(), is(equalTo("openhab/items/myLampItem2/command")));
    assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON));
    assertThat(ruleEvents.size(), is(not(0)));
    assertThat(ruleEvents.stream().filter(e -> "openhab/rules/myRule21/added".equals(e.getTopic())).findFirst().isPresent(), is(true));
    assertThat(ruleEvents.stream().filter(e -> "openhab/rules/myRule21/state".equals(e.getTopic())).findFirst().isPresent(), is(true));
    List<Event> stateEvents = ruleEvents.stream().filter(e -> "openhab/rules/myRule21/state".equals(e.getTopic())).collect(Collectors.toList());
    assertThat(stateEvents, is(notNullValue()));
    Optional<Event> runningEvent = stateEvents.stream().filter(e -> ((RuleStatusInfoEvent) e).getStatusInfo().getStatus() == RuleStatus.RUNNING).findFirst();
    assertThat(runningEvent.isPresent(), is(true));
    EventSubscriber ruleRemovedEventHandler = new EventSubscriber() {

        @Override
        public Set<String> getSubscribedEventTypes() {
            return Set.of(RuleRemovedEvent.TYPE);
        }

        @Override
        @Nullable
        public EventFilter getEventFilter() {
            return null;
        }

        @Override
        public void receive(Event event) {
            logger.info("RuleRemovedEvent: {}", event.getTopic());
            ruleRemovedEvent = event;
        }
    };
    registerService(ruleRemovedEventHandler);
    ruleRegistry.remove("myRule21");
    waitForAssert(() -> {
        assertThat(ruleRemovedEvent, is(notNullValue()));
        assertThat(ruleRemovedEvent.getTopic(), is(equalTo("openhab/rules/myRule21/removed")));
    });
}
Also used : ItemEventFactory(org.openhab.core.items.events.ItemEventFactory) CoreMatchers(org.hamcrest.CoreMatchers) BeforeEach(org.junit.jupiter.api.BeforeEach) EventSubscriber(org.openhab.core.events.EventSubscriber) RuleRegistry(org.openhab.core.automation.RuleRegistry) SwitchItem(org.openhab.core.library.items.SwitchItem) RuleManager(org.openhab.core.automation.RuleManager) RuleBuilder(org.openhab.core.automation.util.RuleBuilder) LoggerFactory(org.slf4j.LoggerFactory) OnOffType(org.openhab.core.library.types.OnOffType) Checks.requireNonNull(org.eclipse.jdt.annotation.Checks.requireNonNull) Trigger(org.openhab.core.automation.Trigger) RuleEngineImpl(org.openhab.core.automation.internal.RuleEngineImpl) ArrayList(java.util.ArrayList) Nullable(org.eclipse.jdt.annotation.Nullable) Configuration(org.openhab.core.config.core.Configuration) Map(java.util.Map) ModuleBuilder(org.openhab.core.automation.util.ModuleBuilder) EventFilter(org.openhab.core.events.EventFilter) Map.entry(java.util.Map.entry) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) RuleStatusInfoEvent(org.openhab.core.automation.events.RuleStatusInfoEvent) EventPublisher(org.openhab.core.events.EventPublisher) ItemCommandEvent(org.openhab.core.items.events.ItemCommandEvent) RuleRemovedEvent(org.openhab.core.automation.events.RuleRemovedEvent) NonNullByDefault(org.eclipse.jdt.annotation.NonNullByDefault) Logger(org.slf4j.Logger) ItemProvider(org.openhab.core.items.ItemProvider) Collection(java.util.Collection) Action(org.openhab.core.automation.Action) Event(org.openhab.core.events.Event) ItemNotFoundException(org.openhab.core.items.ItemNotFoundException) Set(java.util.Set) ReadyMarker(org.openhab.core.service.ReadyMarker) Collectors(java.util.stream.Collectors) Rule(org.openhab.core.automation.Rule) Item(org.openhab.core.items.Item) Test(org.junit.jupiter.api.Test) ItemRegistry(org.openhab.core.items.ItemRegistry) RuleStatus(org.openhab.core.automation.RuleStatus) List(java.util.List) RuleUpdatedEvent(org.openhab.core.automation.events.RuleUpdatedEvent) RuleAddedEvent(org.openhab.core.automation.events.RuleAddedEvent) JavaOSGiTest(org.openhab.core.test.java.JavaOSGiTest) Assertions(org.junit.jupiter.api.Assertions) Optional(java.util.Optional) ProviderChangeListener(org.openhab.core.common.registry.ProviderChangeListener) EventSubscriber(org.openhab.core.events.EventSubscriber) Action(org.openhab.core.automation.Action) Configuration(org.openhab.core.config.core.Configuration) EventPublisher(org.openhab.core.events.EventPublisher) ItemCommandEvent(org.openhab.core.items.events.ItemCommandEvent) RuleRegistry(org.openhab.core.automation.RuleRegistry) ArrayList(java.util.ArrayList) ItemRegistry(org.openhab.core.items.ItemRegistry) RuleStatusInfoEvent(org.openhab.core.automation.events.RuleStatusInfoEvent) Trigger(org.openhab.core.automation.Trigger) RuleManager(org.openhab.core.automation.RuleManager) RuleStatusInfoEvent(org.openhab.core.automation.events.RuleStatusInfoEvent) ItemCommandEvent(org.openhab.core.items.events.ItemCommandEvent) RuleRemovedEvent(org.openhab.core.automation.events.RuleRemovedEvent) Event(org.openhab.core.events.Event) RuleUpdatedEvent(org.openhab.core.automation.events.RuleUpdatedEvent) RuleAddedEvent(org.openhab.core.automation.events.RuleAddedEvent) Rule(org.openhab.core.automation.Rule) SwitchItem(org.openhab.core.library.items.SwitchItem) Test(org.junit.jupiter.api.Test) JavaOSGiTest(org.openhab.core.test.java.JavaOSGiTest)

Example 22 with Action

use of org.openhab.core.automation.Action in project openhab-core by openhab.

the class AutomationIntegrationJsonTest method assertThatARuleFromJsonFileIsAddedAutomatically.

@Test
public void assertThatARuleFromJsonFileIsAddedAutomatically() {
    logger.info("assert that a rule from json file is added automatically");
    // WAIT until Rule modules types are parsed and the rule becomes IDLE
    waitForAssert(() -> {
        assertThat(ruleRegistry.getAll().isEmpty(), is(false));
        Optional<Rule> rule2 = ruleRegistry.stream().filter(RulePredicates.hasAnyOfTags("jsonTest").and(RulePredicates.hasAnyOfTags("references").negate())).findFirst();
        assertThat(rule2.isPresent(), is(true));
        RuleStatusInfo ruleStatus2 = ruleManager.getStatusInfo(rule2.get().getUID());
        assertThat(ruleStatus2.getStatus(), is(RuleStatus.IDLE));
    }, 10000, 200);
    Optional<Rule> optionalRule = ruleRegistry.stream().filter(RulePredicates.hasAnyOfTags("jsonTest").and(RulePredicates.hasAnyOfTags("references").negate())).findFirst();
    assertThat(optionalRule.isPresent(), is(true));
    Rule rule = optionalRule.get();
    assertThat(rule.getName(), is("ItemSampleRule"));
    assertTrue(rule.getTags().contains("sample"));
    assertTrue(rule.getTags().contains("item"));
    assertTrue(rule.getTags().contains("rule"));
    Optional<? extends Trigger> trigger = rule.getTriggers().stream().filter(t -> "ItemStateChangeTriggerID".equals(t.getId())).findFirst();
    assertThat(trigger.isPresent(), is(true));
    assertThat(trigger.get().getTypeUID(), is("core.GenericEventTrigger"));
    assertThat(trigger.get().getConfiguration().get("eventSource"), is("myMotionItem"));
    assertThat(trigger.get().getConfiguration().get("eventTopic"), is("openhab/items/*"));
    assertThat(trigger.get().getConfiguration().get("eventTypes"), is("ItemStateEvent"));
    Optional<? extends Action> action = rule.getActions().stream().filter(a -> "ItemPostCommandActionID".equals(a.getId())).findFirst();
    assertThat(action.isPresent(), is(true));
    assertThat(action.get().getTypeUID(), is("core.ItemCommandAction"));
    assertThat(action.get().getConfiguration().get("itemName"), is("myLampItem"));
    assertThat(action.get().getConfiguration().get("command"), is("ON"));
    RuleStatusInfo ruleStatus = ruleManager.getStatusInfo(rule.getUID());
    assertThat(ruleStatus.getStatus(), is(RuleStatus.IDLE));
}
Also used : ItemEventFactory(org.openhab.core.items.events.ItemEventFactory) VolatileStorageService(org.openhab.core.test.storage.VolatileStorageService) CoreMatchers(org.hamcrest.CoreMatchers) BeforeEach(org.junit.jupiter.api.BeforeEach) TriggerType(org.openhab.core.automation.type.TriggerType) EventSubscriber(org.openhab.core.events.EventSubscriber) RuleRegistry(org.openhab.core.automation.RuleRegistry) SwitchItem(org.openhab.core.library.items.SwitchItem) RuleManager(org.openhab.core.automation.RuleManager) LoggerFactory(org.slf4j.LoggerFactory) OnOffType(org.openhab.core.library.types.OnOffType) Trigger(org.openhab.core.automation.Trigger) RuleEngineImpl(org.openhab.core.automation.internal.RuleEngineImpl) Input(org.openhab.core.automation.type.Input) ManagedRuleProvider(org.openhab.core.automation.ManagedRuleProvider) StorageService(org.openhab.core.storage.StorageService) RulePredicates(org.openhab.core.automation.RulePredicates) Nullable(org.eclipse.jdt.annotation.Nullable) EventFilter(org.openhab.core.events.EventFilter) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) RuleStatusInfoEvent(org.openhab.core.automation.events.RuleStatusInfoEvent) EventPublisher(org.openhab.core.events.EventPublisher) ItemCommandEvent(org.openhab.core.items.events.ItemCommandEvent) RuleStatusInfo(org.openhab.core.automation.RuleStatusInfo) NonNullByDefault(org.eclipse.jdt.annotation.NonNullByDefault) Logger(org.slf4j.Logger) ItemProvider(org.openhab.core.items.ItemProvider) Collection(java.util.Collection) Action(org.openhab.core.automation.Action) Event(org.openhab.core.events.Event) UnDefType(org.openhab.core.types.UnDefType) ItemNotFoundException(org.openhab.core.items.ItemNotFoundException) Set(java.util.Set) ConfigDescriptionParameter(org.openhab.core.config.core.ConfigDescriptionParameter) ReadyMarker(org.openhab.core.service.ReadyMarker) Rule(org.openhab.core.automation.Rule) Item(org.openhab.core.items.Item) Test(org.junit.jupiter.api.Test) ItemRegistry(org.openhab.core.items.ItemRegistry) RuleStatus(org.openhab.core.automation.RuleStatus) AfterEach(org.junit.jupiter.api.AfterEach) Output(org.openhab.core.automation.type.Output) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) ActionType(org.openhab.core.automation.type.ActionType) JavaOSGiTest(org.openhab.core.test.java.JavaOSGiTest) Optional(java.util.Optional) ProviderChangeListener(org.openhab.core.common.registry.ProviderChangeListener) ModuleTypeRegistry(org.openhab.core.automation.type.ModuleTypeRegistry) RuleStatusInfo(org.openhab.core.automation.RuleStatusInfo) Rule(org.openhab.core.automation.Rule) Test(org.junit.jupiter.api.Test) JavaOSGiTest(org.openhab.core.test.java.JavaOSGiTest)

Example 23 with Action

use of org.openhab.core.automation.Action in project openhab-core by openhab.

the class BasicConditionHandlerTest method assertThatConditionWorksInRule.

@Test
public void assertThatConditionWorksInRule() throws ItemNotFoundException {
    String testItemName1 = "TriggeredItem";
    String testItemName2 = "SwitchedItem";
    /*
         * Create Rule
         */
    logger.info("Create rule");
    Configuration triggerConfig = new Configuration(Map.of("itemName", testItemName1));
    List<Trigger> triggers = List.of(ModuleBuilder.createTrigger().withId("MyTrigger").withTypeUID(ItemStateTriggerHandler.UPDATE_MODULE_TYPE_ID).withConfiguration(triggerConfig).build());
    List<Condition> conditions = List.of(getPassingCondition());
    Map<String, Object> cfgEntries = new HashMap<>();
    cfgEntries.put("itemName", testItemName2);
    cfgEntries.put("command", "ON");
    Configuration actionConfig = new Configuration(cfgEntries);
    List<Action> actions = List.of(ModuleBuilder.createAction().withId("MyItemPostCommandAction").withTypeUID(ItemCommandActionHandler.ITEM_COMMAND_ACTION).withConfiguration(actionConfig).build());
    // prepare the execution
    EventPublisher eventPublisher = getService(EventPublisher.class);
    // start rule engine
    RuleEngineImpl ruleEngine = requireNonNull((RuleEngineImpl) getService(RuleManager.class));
    ruleEngine.onReadyMarkerAdded(new ReadyMarker("", ""));
    waitForAssert(() -> assertTrue(ruleEngine.isStarted()));
    EventSubscriber itemEventHandler = new EventSubscriber() {

        @Override
        public Set<String> getSubscribedEventTypes() {
            return Set.of(ItemCommandEvent.TYPE);
        }

        @Override
        @Nullable
        public EventFilter getEventFilter() {
            return null;
        }

        @Override
        public void receive(Event event) {
            logger.info("Event: {}", event.getTopic());
            if (event.getTopic().contains(testItemName2)) {
                BasicConditionHandlerTest.this.itemEvent = event;
            }
        }
    };
    registerService(itemEventHandler);
    Rule rule = RuleBuilder.create("MyRule" + new Random().nextInt()).withTriggers(triggers).withConditions(conditions).withActions(actions).withName("MyConditionTestRule").build();
    logger.info("Rule created: {}", rule.getUID());
    logger.info("Add rule");
    ruleRegistry.add(rule);
    logger.info("Rule added");
    logger.info("Enable rule and wait for idle status");
    ruleEngine.setEnabled(rule.getUID(), true);
    waitForAssert(() -> {
        final RuleStatusInfo ruleStatus = ruleEngine.getStatusInfo(rule.getUID());
        assertThat(ruleStatus.getStatus(), is(RuleStatus.IDLE));
    });
    logger.info("Rule is enabled and idle");
    logger.info("Send and wait for item state is ON");
    eventPublisher.post(ItemEventFactory.createStateEvent(testItemName1, OnOffType.ON));
    waitForAssert(() -> {
        assertThat(itemEvent, is(notNullValue()));
        assertThat(((ItemCommandEvent) itemEvent).getItemCommand(), is(OnOffType.ON));
    });
    logger.info("item state is ON");
    // now make the condition fail
    Rule rule2 = RuleBuilder.create(rule).withConditions(ModuleBuilder.createCondition(rule.getConditions().get(0)).withConfiguration(getFailingConfiguration()).build()).build();
    ruleRegistry.update(rule2);
    // prepare the execution
    itemEvent = null;
    eventPublisher.post(ItemEventFactory.createStateEvent(testItemName1, OnOffType.ON));
    waitForAssert(() -> {
        assertThat(itemEvent, is(nullValue()));
    });
}
Also used : Condition(org.openhab.core.automation.Condition) EventSubscriber(org.openhab.core.events.EventSubscriber) Action(org.openhab.core.automation.Action) Configuration(org.openhab.core.config.core.Configuration) EventPublisher(org.openhab.core.events.EventPublisher) RuleEngineImpl(org.openhab.core.automation.internal.RuleEngineImpl) HashMap(java.util.HashMap) RuleStatusInfo(org.openhab.core.automation.RuleStatusInfo) Trigger(org.openhab.core.automation.Trigger) Random(java.util.Random) ItemCommandEvent(org.openhab.core.items.events.ItemCommandEvent) Event(org.openhab.core.events.Event) Rule(org.openhab.core.automation.Rule) ReadyMarker(org.openhab.core.service.ReadyMarker) Test(org.junit.jupiter.api.Test) JavaOSGiTest(org.openhab.core.test.java.JavaOSGiTest)

Example 24 with Action

use of org.openhab.core.automation.Action in project openhab-core by openhab.

the class RuntimeRuleTest method assertThatTimerTriggerWorks.

@Test
public void assertThatTimerTriggerWorks() {
    String testItemName = "myLampItem";
    List<Event> itemEvents = new LinkedList<>();
    EventSubscriber itemEventHandler = new EventSubscriber() {

        @Override
        public void receive(Event event) {
            if (event.getTopic().contains(testItemName)) {
                itemEvents.add(event);
            }
        }

        @Override
        public java.util.Set<String> getSubscribedEventTypes() {
            return Set.of(ItemCommandEvent.TYPE);
        }

        @Override
        @Nullable
        public EventFilter getEventFilter() {
            return null;
        }
    };
    registerService(itemEventHandler);
    /*
         * Create Rule
         */
    logger.info("Create rule");
    String testExpression = "* * * * * ?";
    Configuration triggerConfig = new Configuration(Map.of("cronExpression", testExpression));
    List<Trigger> triggers = List.of(ModuleBuilder.createTrigger().withId("MyTimerTrigger").withTypeUID(GenericCronTriggerHandler.MODULE_TYPE_ID).withConfiguration(triggerConfig).build());
    Map<String, Object> cfgEntries = new HashMap<>();
    cfgEntries.put("itemName", testItemName);
    cfgEntries.put("command", "ON");
    Configuration actionConfig = new Configuration(cfgEntries);
    List<Action> actions = List.of(ModuleBuilder.createAction().withId("MyItemPostCommandAction").withTypeUID("core.ItemCommandAction").withConfiguration(actionConfig).build());
    Rule rule = RuleBuilder.create("MyRule" + new Random().nextInt()).withTriggers(triggers).withActions(actions).withName("MyTimerTriggerTestRule").build();
    logger.info("Rule created: {}", rule.getUID());
    logger.info("Add rule");
    ruleRegistry.add(rule);
    logger.info("Rule added");
    logger.info("Enable rule and wait for idle status");
    ruleEngine.setEnabled(rule.getUID(), true);
    waitForAssert(() -> {
        final RuleStatusInfo ruleStatus = ruleEngine.getStatusInfo(rule.getUID());
        assertThat(ruleStatus.getStatus(), is(RuleStatus.IDLE));
    });
    logger.info("Rule is enabled and idle");
    waitForAssert(() -> {
        assertThat(itemEvents.size(), is(3));
    });
}
Also used : EventSubscriber(org.openhab.core.events.EventSubscriber) Action(org.openhab.core.automation.Action) Configuration(org.openhab.core.config.core.Configuration) HashMap(java.util.HashMap) LinkedList(java.util.LinkedList) RuleStatusInfo(org.openhab.core.automation.RuleStatusInfo) Trigger(org.openhab.core.automation.Trigger) Random(java.util.Random) ItemCommandEvent(org.openhab.core.items.events.ItemCommandEvent) Event(org.openhab.core.events.Event) Rule(org.openhab.core.automation.Rule) Test(org.junit.jupiter.api.Test) JavaOSGiTest(org.openhab.core.test.java.JavaOSGiTest)

Example 25 with Action

use of org.openhab.core.automation.Action in project openhab-core by openhab.

the class RuleEngineTest method createActions.

private List<Action> createActions(String type) {
    List<Action> actions = new ArrayList<>();
    Configuration configurations = new Configuration();
    configurations.put("a", "x");
    configurations.put("b", "y");
    configurations.put("c", "z");
    Map<String, String> inputs = new HashMap<>(11);
    String ouputModuleId = "triggerId";
    String outputName = "triggerOutput";
    String inputName = "actionInput";
    inputs.put(inputName, ouputModuleId + "." + outputName);
    inputs.put("in6", ouputModuleId + "." + outputName);
    actions.add(ModuleBuilder.createAction().withId("actionId").withTypeUID(type).withConfiguration(configurations).withInputs(inputs).build());
    return actions;
}
Also used : Action(org.openhab.core.automation.Action) Configuration(org.openhab.core.config.core.Configuration) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList)

Aggregations

Action (org.openhab.core.automation.Action)40 Trigger (org.openhab.core.automation.Trigger)27 Configuration (org.openhab.core.config.core.Configuration)22 Rule (org.openhab.core.automation.Rule)20 HashMap (java.util.HashMap)19 JavaOSGiTest (org.openhab.core.test.java.JavaOSGiTest)16 Test (org.junit.jupiter.api.Test)15 Condition (org.openhab.core.automation.Condition)15 ArrayList (java.util.ArrayList)14 Random (java.util.Random)13 Nullable (org.eclipse.jdt.annotation.Nullable)12 Event (org.openhab.core.events.Event)12 EventSubscriber (org.openhab.core.events.EventSubscriber)12 ItemCommandEvent (org.openhab.core.items.events.ItemCommandEvent)12 RuleRegistry (org.openhab.core.automation.RuleRegistry)9 RuleStatusInfoEvent (org.openhab.core.automation.events.RuleStatusInfoEvent)9 EventPublisher (org.openhab.core.events.EventPublisher)9 NonNullByDefault (org.eclipse.jdt.annotation.NonNullByDefault)8 Item (org.openhab.core.items.Item)8 Logger (org.slf4j.Logger)8