How to manually add things to binding


hopefully I am in the correct subsection here.
I’m currently developing a binding for Nedap PowerRouters (

The idea is to make the binding configurable and after the user has entered the credentials
things shall be added.

So far the handlerfactory looks like this

@Component(service = ThingHandlerFactory.class, immediate = true, configurationPid = "binding.nedappowerrouter")
public class NedapPowerRouterHandlerFactory extends BaseThingHandlerFactory {
    protected void activate(ComponentContext componentContext) {

        Dictionary<String, Object> properties = componentContext.getProperties();
        String user = (String) properties.get("username");
        String pass = (String) properties.get("password");
       if (user == null || user.isEmpty() || pass == null || pass.isEmpty()) {
            logger.warn("Username / Password needs to be configured!");
        logger.debug("Binding credentials updated with {} / {}", user, pass);

        try {
            logger.debug("Login to was {} ", routerClient.isUserLoggedIn());
        } catch (ClientProtocolException e) {
        } catch (IOException e) {

My question is how do I add things manually?
I don’t want to add them prior to entering the credentials since the amount of things depends on the
router someone has.

I know about the discovery service and tried it but restarting a scan by code seems not possible…

Thanks in advance

Suggest using StringUtils.isEmpty() instead. This returns true if the variable is either null or empty.

Sorry I don’t have an answer for the question, though.