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.
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…