Developing a Binding for DLink Plugs

@MikeJMajor might be able to help you, I have not had time to mess with openhab in a couple of months. I think it should just show up. Where are you trying to find it in paper ui?

Looking under bindings, but kinda looked around all over the place for it.

Any help would be appreciated as it core functionality for me

If you login to the karaf console and type bundle:list do you see any bundles with dlink in the name?

I have the same issue, bundle:list shows both D-link bundles ->
D-Link Smart Home Binding
DLinkSmartPlugs Binding
but I can only see the “D-Link Smart Home Binding” bundle in paperui bindings.
Any idea?

Oops, I had the wrong plugin, so the binding now appears in paperui, yippee. However the plugs still don’t work after adding them manully. The error I’m getting is ->
Status: OFFLINE - CONFIGURATION_ERROR Can not contact device, UNSUPPORTED_FIRMWARE
The firmware I have is 1.25
Any help appreciated

First, I’d like to thank you for this plugin, it’s cool. :slight_smile:

Do you have an updated code somewhere, where you’ve fixed the lock-up issue? I couldn’t find it in your Github repo.

Also, do you have any plans to do the finishing touches, and make a pull request?

The lock-up issue was fixed by @MikeJMajor. The code base it was being developed under was moved: https://github.com/openhab/openhab2-addons/pull/2035

I do not see any commits from me in his code, so I may never have actually submitted the changes. I remember I was waiting for his work to be approved so I would not mess up his pull request. My code was finished and functioning, however variable names etc did not match community standards, which is why I never submitted an official pull request.

The very first post in this thread has a link to the compiled functioning jar file that I use in my own openhab2 installation.

I just tried syncing my code base with @MikeJMajor s, and it said I did not have permission to do so. Perhaps he revoked it, or I did something wrong. I have no problem giving the code to someone, at the moment I am working on location aware algorithms for my house and don’t have time to struggle through github and spiffing up the code.

I am not a huge fan of github, I find it very clunky and painful to use, so whenever I am forced to use it it is very slow going.

@Jereme_Guenther So if I read this thread correctly, the binding is not available within OpenHab2 but can be installed manually? Also will it work with DSP-W110? Thanks

@Rathna-K Yes, that is all correct. DSP-W110 is the model I used during development.

Thanks, I am downloading now. How do I create a thing file? is there an example for that? And the below is still right for Items and Sitemap? And finally, do I need to do the PaperUI config as mentioned below? I am running off of Raspberry Pi so if I need to make that change can you tell me where this would go? Thanks in advance!

ITEMS:
String DSPW215 “dsp-w215” { channel=“exec:command:internetplug:input”}
String DSPW215s “dsp-status [%s]” { channel=“exec:command:testplug:output”}

SITEMAP:
Switch item=DSPW215 mappings=[“on”=“on”, “off”=“off”]
Text item=DSPW215s

PAPERUI config:
internetplug (interval=0 autorun=on):
node C:\dsp-w215-hnap-master\app.js %2$s
testplug (interval=10, autorun=off):
node C:\dsp-w215-hnap-master\app.js state

@Jereme_Guenther getting this exception. maybe conflicting names for existing binding from openhab 2.3 snapshot?

11:42:50.365 [ERROR] [org.openhab.binding.dlinksmarthome   ] - FrameworkEvent ERROR - org.openhab.binding.dlinksmarthome
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.dlinksmarthome [289]
  Another singleton bundle selected: osgi.identity; type="osgi.bundle"; version:Version="2.3.0.201802191719"; osgi.identity="org.openhab.binding.dlinksmarthome"; singleton:="true"

        at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

That could be true, especially if the version without the plug code in it has been integrated.

I’ve been buried in upgrading my camera system for the last half year or so. I would still like to finish up this binding, however due to the security issues in the DLink firmware I am certainly not promoting getting their stuff.

@Jereme_Guenther any chance you could compile for the current 2.3.0 Snapshot and post the jar? or maybe rename the binding or something so we could use it?

Perhaps eventually. Choosing Git as the source control causes lots of issues for many developers, and I happen to be one of those. Generally speaking it is a very poor choice for a source control system unless you work in it every day, which I do not. I wish Git would improve their system and make it user friendly, however, after years of waiting I have given up hope that they will.

So before I can even think about updates to this code I need to struggle through a lot of git commands to figure out how to update the code to the latest version.

any chance of a code update for this add on? or any manual way to include this in my setup?

Probably not for awhile, unless you are a developer and want to do the work yourself.

Git finally released an updated GUI which is much better than the old one. But I still need to successfully get the latest version of openhab. Git updated my other code bases, but it does not seem to have been successful with openhab, so i’ll have to figure that out when I get spare time.

I am more than happy to help someone else get the code. At this point I think all it needs is the community standards cleanup to be accepted into the main code base. That’s just a lot of work for someone who rarely works in Java.

Hi Jereme,

I would love to help take this over if you would share you code with me. I would clean it up and ask it to be added to the base! I am new to openhab but have been a professional developer for 15 years and am looking for ways to give back to this project.

That would be great. I hope you have more success with Eclipse than I have.

Hi, any plans to migrate to OH3 with this binding?

There’s an open PR for adding support for plugs: