Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Things disable worked, Things enable does nothing #718

Closed
openPhiL opened this issue Mar 9, 2019 · 2 comments · Fixed by #1243
Closed

Things disable worked, Things enable does nothing #718

openPhiL opened this issue Mar 9, 2019 · 2 comments · Fixed by #1243
Labels
bug An unexpected problem or unintended behavior of the Core

Comments

@openPhiL
Copy link

openPhiL commented Mar 9, 2019

hi.
Just tried out the disable button on the paper-ui-configuration-things section, for a errornous binding (unify). Worked as expected.

2019-03-09 22:15:48.131 [hingStatusInfoChangedEvent] - 'unifi:site:3d20632a' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to UNINITIALIZED (DISABLED)

Now, clicking the enable button, I receive the little popup "Thing enabled", but "nothing" happens and nothing appears in the log. I expect "something" "anywhere" :D

I could try to change the log:set, but don't know for what org.openhab.thing?

@wborn
Copy link
Member

wborn commented Apr 14, 2019

The "handler missing error" suggests that you've uninstalled the binding after having added the thing.

I can also reproduce the issue this way:

  1. Add thing from a binding
  2. Uninstall this binding
  3. Disable thing
  4. Enable thing

I think it would make sense if the framework set the thing to enabled and updated the status to "UNINITIALIZED (HANDLER_MISSING_ERROR)" again.

Obviously you can get the thing to initialize properly by installing the binding again.

According to the code it does try to register and initialize the Thing again:

public void setEnabled(ThingUID thingUID, boolean enabled) {
Thing thing = getThing(thingUID);
persistThingEnableStatus(thingUID, enabled);
if (thing == null) {
logger.debug("Thing with the UID {} is unknown, cannot set its enabled status.", thingUID);
return;
}
if (enabled) {
// Enable a thing
if (thing.getStatus().equals(ThingStatus.ONLINE)) {
logger.debug("Thing {} is already in the required state.", thingUID);
return;
}
logger.debug("Thing {} will be enabled.", thingUID);
if (isHandlerRegistered(thing)) {
// A handler is already registered for that thing. Try to initialize it.
initializeHandler(thing);
} else {
// No handler registered. Try to register handler and initialize the thing.
registerAndInitializeHandler(thing, findThingHandlerFactory(thing.getThingTypeUID()));
}
} else {

@wborn wborn changed the title PaperUI - Things disable worked, Things enable does nothing Things disable worked, Things enable does nothing Apr 14, 2019
@wborn wborn transferred this issue from openhab/openhab-distro Apr 14, 2019
@wborn wborn added the bug An unexpected problem or unintended behavior of the Core label May 22, 2019
@Rossko57
Copy link

Comment only - the "UNINITIALIZED (HANDLER_MISSING_ERROR)" status can be produced where there is a Thing hierarchy e.g a Bridge Thing is disabled and related Thing attempts to go online.(without removing binding).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
3 participants