Missing: A binding for Discovergy Smart Meters! :-)

same for me

I also would appreciate a Discovergy Binding.

I’ll get one of these Smart Meters soon aswell, so I am looking for a way to integrate this into OpenHAB. I am not completely new to binding development, I have done that before but my previous bindings are more of a “do not do it this way”-example, which is why I was never brave enough to make a PR for those. Anyways, here are my first thoughts:

Except that this example uses all sorts of libraries that are not the recommended libraries. So basically it needs to be rewritten with the recommended libraries.

Fortunately there is a demo account available so everybody can help. :wink:

The correct approach for this binding would probably be a bridge for the account and then have the individual meters as things. Unfortunately I have never done any bridge-binding development… Anyways, in the bridge’s initialize() I do the login to the API, if it suceeds I set the bridge to online, otherwise to offline? How do I do the things discovery now? I assume all things wait for their bridge to go online before they are actually initialized? Also does anybody know how long an oauth1 token is valid? How would I automatically refresh it if it is about to expire (or has expired)? As a thing can get it’s bridge object the token is just a variable in the bridge object so the thing can get it from there? Also is someone willing to do all the final work that is still necessary when I have a kinda working binding somehow up and running? Unfortunately I won’t be able to do all the work by myself…

I came up with a binding for now (so disregard all the questions in my previous post :wink: ), however I haven’t tested it at all yet and I am sure that once I will do so it will throw all kinds of errors at me. I will probably do that tomorrow.

I’ve tested it now and it works! Just missing auto discovery and I am not sure if I need any additional handling for an expired token (I guess I do), but once that is added it should be pretty much good to go.

It’s defined by the service you integrated with. It should be mentioned in the API docs they provide.

That too should be described in the API docs. For another service I implemented something like this for, you get a refresh token when you first get the auth token that you can use to renew/request a new auth token. See OAuth2 using just OH Rules and myopenhab.org

You should get a specific error coffee when you make a request after the sith token has expired.

They just describe that “when the status code indicates that the token is invalid it should be refreshed”. Very vague in my opinion. I’ll just leave this running for now and see what happens after some time, maybe the library takes care of this already.

I also got the auto discovery working now, so all that’s left is the token refresh and getting this thing merged (which will be quite some effort). Also I probably need to contact Discovergy regarding the license of the published samples, especially to figure out if we can use them at all for an openhab binding (and distribute it under openhabs license).

Little update: Token refresh is now working aswell, unfortunately I didn’t get any clarification on the license yet so this is kinda on hold at the moment. Also there are some special cases that require some minor adaptations but other than that this binding is working absolutely great for me.

Happy New Year to everybody!!! :slight_smile:

#push :wink: - Did anybody manage to develop a working openHAB-integration of Discovergy Smart Meters?

Yes, as I mentioned earlier I developed a working binding. I’ve been using it for quite some time now and its stable, at least for power meters.

Which smartmeters (or interfaces) does it support?
The wm-bus binding mentioned earlier in this thread does not work with a IMST USB dongle.

It supports whatever electricity meters discovergy decides to use. There are a few different types as far as I know, I don’t know which ones though.

Okay…

Hi Flole,
do you offer a download for your binding?
I would really like to use it.

Regards,
Holger

Hi Holger,

I still can’t publish it as the license of the examples and their libraries still hasn’t been clarified by discovergy. Feel free to contact them and ask for clarification (I didn’t get an answer when I did that), once that is done I might be able to release it (depending on their license).

Kind regards

Flole

Hallo Flole,

I just wrote an e-Mail to Discovergy to get clarity concerning the legal issues. I pointed to this thread and asked for a reply.

Regards,
Holger

Hi @Holger_Richter,

I assume you never got a response?

Kind regards

Flole

Hi Flole,

I asked “discovergy” 3 times and they told me my request would still be processed. But I will not give up.

Regards,
Holger

I asked them in the official forum again a few days ago. Unfortunately I lost the source code of my binding. While I still have the sources.jar it all needs to be put together so it builds again. So even if they clarify the license there will only be a jar-file based addon and a bunch of source files, I won’t go through the “putting everything back together”, especially since this is not in a state that would have a chance of getting it merged as the guidelines have changed.

… and just a few hours after my post they clarified the license in the Forum and are also considering adding a license file. I’ll publish my binding as a jar file tomorrow, I think this clarification is sufficient to not get sued :wink: