Contributing a new binding

I’ve created a simple binding for Sony Bravia TVs. I’ve seen an older (possibly v1) binding for Sony TVs, but it’s been removed from the listing. That binding did not support pre shred keys (PSK), which I personally think is a requirement. It also did not support pulling the status of the TV, and triggering rules off the status change. The binding that I’ve created supports PSK and status updates.

The code is here: https://github.com/haavar/org.openhab.binding.sonybravia

How do I go about contributing this back to the community?

1 Like

Just to provide some additional info. The IoT Marketplace is a great place to get your binding out there and easy for users to test. Once you are happy with the binding and confident it is ready for inclusion, you would need to submit a PR to the openhab2-addons github repo.

As part of the PR the code will need to be signed off/over the code to the Eclipse foundation and use the Eclipse License. If that is a deal killer for you then the IoT Marketplace is probably your last stop. It is important to the project that all software distributed through the official distribution channels have a clearly documented intellectual property status.

Once the PR is submitted, the maintainers will review it, may ask for some changes, and eventually merge it into the baseline. At that point it will become part of the baseline and available as a binding in PaperUI.

I’ve created a simple binding for Sony Bravia TVs.

Please note that @tmrobert8 has been working on a Sony binding for quite some time as well, see https://github.com/openhab/openhab2-addons/pull/1249. I don’t know about the latest state and his plans for finishing it, but it would make sense to liaise with him.

@haavar

This is Tim Roberts - I’m the one who wrote the sony binding (which supports sony tvs, avrs and soundbars) which you can find at Sony Devices Binding

The binding supports discovery, authentication and usage of various sony services. Should support PSK but you’d be about the only person I know trying a PSK (most just use the auto authentication method).

I took a quick look at your code - you are using the scalar method to toggle the power switch and that’s definitely supported in the sony binding (in addition to pretty much everything scalar has to offer). Just a suggestion if you are going to continue with your binding - you’ve hardcoded alot of stuff (not only the scalar method but also the PSK path/header value) - that may work on your TV but other TVs have different setups. You’ll need to evaluate the UPNP messages to properly get those values (you can take a look at my code if you want for hints).

If you want and have the time, we can combine efforts on the sony binding - I have a huge list of things that need to be done and not enough time (most important is trying to get the code in shape to be merged and integrating websockets into the scalar code). Please let me know if you have interest in helping out (and have the technical knowledge to take this on - it’s quite complex and everything is pretty much dynamic).

Tim

1 Like

Does anyone have the API documentation for Sony TV’s? I may be able to help a little with whatever project is going to be active going forward.

@matt1

There is no documentation for sony tvs (or any other products) - I’ve been developing all of it based on Wiresharking, deducing and researching the API. However, I’d love help if you are willing…

Tim