Sony Devices Binding for OH3

Thank you for pointing in the direction of Android Debug Bridge. It worked like a charm!

For anyone it may concern: After installing the binding, I had to manually add my Android TV device by its IP. Current app status appears in the following channel:

String SonyTVApp "Current App" { channel="androiddebugbridge:android:sony:current-package"}

First of all, thanks a lot for the great binding.
My binding and things works well, both IRCC and Scale things can function good, but when I check into the log, I found that my IRCC things is getting OFFline then Online every 30s, anyone have any idea?
Thanks in advance.

Patrick

Your observation might be related to the retry process, whch tries to detect if a Sony device has been switched on outside OH.

For further analysis it would be great if you could provide the following information:

  • Source/version of the binding. Please note that only the marketplace versions will be supported.
  • Configuration (including value of discovery.sony-ircc:background)
  • Log output

@andan Thanks for the work you do to keep this binding alive!!

Now that 3.4 is released, and openHAB development has moved to 4.0, were you planning to do a 4.0.0 build of the binding?

I intend to keep maintaining the binding for future OH releases as long as there is any interest (includung mine :wink: )

Iā€™m also thinking to create a PR for getting this binding merged into the official addons repo,
However, Iā€™m a bit reluctant to do this without support or at least the go from the original developer who seems to have left the OH community. The code is quite complex and contains some ā€˜ideosyncraticā€™ type solutions which would have the potential to make the PR review process quite time consuming for both the reviewer and the requestor.

1 Like

Iā€™m interested, too. :wink:

I looked at the code a while back, and I agree with your reluctance to submit a PR for all the reasons you mention. It could be very gnarly to get through the review process. And Iā€™m not sure that effort will yield much additional value, compared with the far less effort to keep the binding available in the marketplace.

The build for 4.0 looks pretty straightforward - POM change, copyright notice change, and a few SAT errors. Iā€™m running it in 4.0 now, but I just did -DskipChecks=true to get past the SAT errors. :wink:

Iā€™m also still interested in your binding Andreas. And always available in case you need someone for testing :wink:

Thank you for the awesome Sony binding! Iā€™m currently using the Scalar API in the Sony Devices Binding to control the Power Saving Mode on a Sony A80J TV and itā€™s been working great!

Iā€™m now trying to use the Scalar API to control the Audio Output option on the Sony A80J TV. The exact API Iā€™m trying to use is documented here on Sonyā€™s website.

Iā€™m trying to switch between using ā€œSpeakerā€ or ā€œaudioSystemā€ on the A80J, which according to the API should be possible. I can switch between these options using the menu on the TV without any issues but Iā€™m having trouble getting this to work with the binding.

Under the Thing for my A80J, Iā€™m using the Sound Setting output Terminal () Channel linked to a Switch Item, but the TV does not seem to recognize the command. Looking at the API, I was thinking the Item might need to be a String instead of a Switch but that didnā€™t seem to work either (unless I donā€™t have the syntax right.)

Any ideas why the TV isnā€™t recognizing the command or anything else I can try? Thank you!

My ideas what you could try to solve/analyse the issue are

  • Link sound setting channel to string item and send either command speaker or audioSystem from the item
  • Use built-in Sony REST API support (see doc), select setSoundSetting service, and execute it with parameters {"target":"outputTerminal","value":"audioSystem"}
  • Generate debug log output

If you send me the respective results/outcome I could try to analyse the issue from my end.

Hi @andan, thanks for the help! I tried linking the sound setting channel to a string item but still couldnā€™t my TV to recognize the command. And unfortunately, when I tried to access the API via browser, all that displayed was a blank page (Iā€™m wondering if something changed recently with accessing the API via browser).

However, you gave me an idea to try accessing the API using an API testing tool. I ended up using Postman and discovered thereā€™s a way to pull all the supported API commands for my TV using the below.

{"method":"getMethodTypes","params":[""],"id":1,"version":"1.0"}

When running the above in Postman, the results donā€™t list the setSoundSettings API. The setPowerSavingMode was listed and that is working correctly so I believe since setSoundSettings isnā€™t listed, my TV doesnā€™t support it.

I did some more tinkering and discovered there is a way to control the Audio Output using IRCC. Using the below in Postman I found the IRCC code for AudioOutput_Toggle.

{"method":"getRemoteControllerInfo","params":[""],"id":1,"version":"1.0"}

With the above discovery, I created an IRCC Thing for my TV linked to an IRCC Command and accomplished what I need with some rules. The IRCC method is working great so I should be all set!

TLDR :smile: I couldnā€™t get my TV to recognize the Scalar API to control the Audio Output. Instead of using Scalar, I was able to use IRCC.

Great to hear that you have found a working solution using the IRCC service.

Just for my understanding: Does the getMethodTypes request return the getSoundSettings method?

The background is that in general the binding checks the existence of available services via a getMethodTypes request and dynamically creates the channels accordingly. However, for the soundSetting channel, the check is limited to the getSoundSettings method. In that case, the soundSetting channel should still work as a read only channel.

Can you confirm this expected behaviour?

My Sony devices have no sound settings methods so I cannot check it from my end.

Thanks.

Out of curiosity, is it possible to control an Android TV based Sony TV using the Google TV app? Im working on a binding to incorporate Google TV and im curious if the Sony TVs may be a candidate for use. Thanks!

Yes, Sony Android TVs are supported by Google TV. I have 3 Sony Android TVs all works.

1 Like

Awesome. Thanks!

This is a Sony Device binding for OH4M1 question. I tried to upgrade to OH4M1 from OH3.4 and ran into a problem. I posted the issue on the OH4M1 thread here. The only binding I have from the Marketplace is the Sony binding, so based on the few posts after mine it could be an issue. Questions: Is the Sony binding OH4.0 capable at the present time? Could it be made capable with the

If the developer compiles the jar with the following options it will work on 3.2.0 through 4.0.0

-Dohc.version=3.2.0 -Dmaven.compiler.source=11 -Dmaven.compiler.target=11 -Dkaraf.version=4.3.7

Lastly it did seem to work even with the log errors, but I reverted back to 3.4 due to another problem.

I know you picked this up reluctantly, just looking for information at this point. Also would be willing to test something if that is needed.

I built a version of the Sony binding for 4.0 and had been running it since very early 4.0 snapshots. But I no longer use it because I now use the AndroidTV binding (my Sony TV is Android-based), and because the Sony binding is pretty much unmaintained and extremely complex.

Fortunately I didnā€™t delete the branch. Feel free to clone it and build yourself a 4.0 version.

For anyone interested in switchingā€¦

This should work on any AndroidTV based device as long as GoogleTV is installed.

I wouldnā€™t say the Sony binding is pretty unmaintained :wink:
I will continue fixing reported issues and adopting it to the latest OH releases for the time being.

However, if this binding is just used for a Sony TV with Android or Google TV support, than there might be no good reason not to switch to the AndroidTV binding.

Iā€™m still wondering if this should be applied as a different kind of protocol use case like we do with ShieldTVā€™s on the AndroidTV binding. GoogleTV gives us a good bit, but we are still missing some things (like ability to have more than RO awareness of apps). On the Shield, we interact with both protocol sets (with Google being primary when possible) to get the most data we can about the device. For apps, we are able to send app start requests to it via the Shield protocol. As there is extensive work here on the protocol, Iā€™m curious if we could pull the missing bits from Sony (not the whole thing, itā€™s WAY to complex) in as another protocol in the stack and just garner what we need from it that we donā€™t get from Google.

Forgive me for asking the stupid questions, I donā€™t have a Sony TV. How many Sony TVs are AndroidTV based from the perspective of what this binding supports? Is it a majority or are the AndoidTVs just a small subset?

Iā€™m sorry. That was a bad choice of words.