Would be nice to have a binding to make this more accesible for users; unfortunately I´m not familiar with maven, GIT nor the OH infrastructure - but could maybe help to implement some classes.
If someone has interest would be a nice addition in my opinion.
I’m also not the right person to ask for this but maybe you could post this idea to the first posting and someone takes up the task. @kubawolanin or @dolic / @opus developed similar bindings recently…
I´ve started to setup the OH2 IDE to get an idea how complex a binding development would be. I created a new empty binding using the script. I can start the runtime; but can not see my stub (nor any other) binding in paperUI:
Any advice is appreciated
with kind regards,
Patrik
You need to select your binding in the setup of the run or debug-configuration to be loaded . The bindings you see selectable on PaperUI have bogus names.
@patrik_gfeller Thanks for giving it a start.
Please don’t forget to open an issue on github for this, so others will know that a binding is under development and discussion about coding related topics/issues can be moved there.
As I was also hinking of stepping in, but stepping back cause of not much time atm, I would like to share my thoughts about how such a binding could look like.
I was thinking of having one bridge thing for each apple account, with appleId, passwort and refresh cycle as configuration options.
The first retrieved data could then be scanned for the devices and things could be created dynamically, identified by uuid and their names.
I would also see channels be created dynamically, according to the retreived data, so it could be taken into account, that not all devices have location data.
Thanks for your inputs … I´ll give it a try to see if I manage to create something that works; but any help is appreciated - as I´m new to almost every aspect involved (git, java osgi …) . Created the issue as sugested:
… basic bridge communication and parsing works; now I´ve to figure out the discovery mechanics to add the devices and how to keep them updated - but I´ve fun:
You are missing to register your deviceDiscovery in handlerFactory, like you can see in WeMo binding e.g.
if (thingTypeUID.equals(WemoBindingConstants.THING_TYPE_BRIDGE)) {
logger.debug("Creating a WemoBridgeHandler for thing '{}' with UDN '{}'", thing.getUID(),
thing.getConfiguration().get(UDN));
WemoBridgeHandler handler = new WemoBridgeHandler((Bridge) thing);
registerDeviceDiscoveryService(handler);
return handler;
This is just a quick response, I will have a closer look this evening…
fortunately I was able to figure out most of the stuff; discovery, parsing & thing handling works in the prototype. But I´ve no idea how far I´m from best practices (e.g. if such code has a chance ever to see the OH2 repo). Thus I would appreciate some feedback prior to going to the work of declaring all the channels.
@patrik_gfeller
Hi Patrick,
if you can update your fork with your latest results, I can do a first review later this evening.
You can even create a PR an mark it as [WIP]…
We can then directly comment on your code.
From What I see in your screenshot, this lokks excellent and is a good result in such a short time.
the fork is up-to-date … curious if it is useable; as I´m not working with java and those frameworks usually.
Depending on your feedback we´ll see how to continue best.
Sure, that is totally OK.
By a signing it Work in progress you are telling the maintainers that there is no need to review the code already. However by having it posted as a PR others could help you.