Sony Devices Binding

@tmrobert8
i downloaded your binding from JFrog but i get errors from it and it wont start.

2018-01-03 00:04:56.033 [ERROR] [org.openhab.binding.sony ] - FrameworkEvent ERROR - org.openhab.binding.sony

org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sony [218]

Unresolved requirement: Import-Package: org.apache.http

at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]

at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]

at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

have i forgotten to do somthing for this to work?

Hi @nick_woodforth,
your problem sounds very similar to mine. Have you checked my problem (post #386) and its solution (post #390)?

Hey ibvhefe,
Thanks for the reply
it had just started working after installing bindings - http binding & tcp/upd binding from the addons. Just before I read your reply.

Hi,

My name is David ƅberg, Iā€™m a developer at Sony Developer World and have had the pleasure to help SONY to release the Sonyā€™s Audio Control API https://developer.sony.com/develop/audio-control-api.

The Audio Control API is a subset of what you may know as the ScalarAPI (ScalarAPI is the internal name, set long before it was decided to make any part of it public).

If you have any questions about the API I will gladly try to answer them, but I can only answer the part of the API that is connected to the Audio (soundbar, receiver and wireless speakers) since this are the only parts that are officially supported by SONY.

For other ways to get suport see https://developer.sony.com/develop/audio-control-api/get-support

David ƅberg
Sony Developer World

8 Likes

Just to let everyone know - David put together a quick ESH sony audio plugin PR and Iā€™m starting some discussions with him on the subject. The public API documentation is great - most of what I have done is confirmed by it and there were a couple of gems that I didnā€™t know about (the biggest being a different way to connect that doesnā€™t require authentication and will support a wider range of devices - including my HT-NT5 soundbar).

While Iā€™m working on making the binding mergable and implementing some of the stuff the API shows - Iā€™ll be having discussions with him and @Kai on the future direction of this binding (whether to make this an ESH binding or not).

5 Likes

Great news and work, @tmrobert8 !

ā€¦Does this mean thereā€™s still a chance this will work with my STR-DN1060? :grin:

@bartus
One of the reference hardware for the API is a DN1080 - so Iā€™m betting that the DN1060 would work fine as well.

1 Like

Excellent, canā€™t wait to try it out!

i had this working on 2 of my 3 sony tvs. but i got a dead sd card and had to start over.
i now cant find the tvs in the inbox. i have removed the openhab remote from the tvs. now i cant work out why they are not being found :frowning:
i can see the binding has loaded as its in the list of installed bindings
i cant find the logs as openhab log viewer isnt working after starting over.
any help working this out would be great :slight_smile:
thanks

I got really excited when I first saw this thread, because I have one SA-NS300 and seven Sony SA-NS400 speakers through the house, and I was hoping that your binding might include them. I wrote some scripts to control them through OH, including putting them into Party mode for announcements, but it would be nice to have it all wrapped into a binding that makes use of audio sinks. I have started to deconstruct the Sonos binding with the intent of putting together a Sony HomeShare binding, but if these devices would become supported by your binding, then Iā€™m probably wasting my time. They are slightly older tech, but is there any chance you would/could be adding support for these speakers?

@freke awesome to see that Sony made a public API! On the device page, only three speakers are listed. Why is it limited to there three? Will other speakers follow or are more speakers than the listed once supported? What about the SRS-ZR7 for example?

Hi @dominicdesu
I hope more speakers will be listed and supported by SONY in the future (I donā€™t know when or which, it is decided in Tokyo), the main reason it is only three, is manpower. It is a lot of work to go through to make this possible, so we selected one of each category (Soundbar, Receiver, Wireless Speaker) and in different price range to start with to make sure that something got released.

The SRS-ZR7 is almost the same as SRS-ZR5 so even if it is not officially supported it will (most likely) work with @tmrobert8 OpenHAB binding.

@freke nice, thanks for the explanation. So the devices already have the capability to be controlled via an API, just the (public) API is missing :upside_down_face:
I am currently looking for a replacement for my Panasonic AllPlay speakers, and the Sony Multiroom speakers look very promising! Iā€™ll keep an eye on the API development :slight_smile:
Thanks for your and @tmrobert8ā€™s effort!

Hi @tmrobert8
I looked in to the docs I have about the HT-NT5 and it uses the same API version as STR-DN1070, this is the receiver I first used to test the API and you should not have any authentication problems with it.

That sad, I had some problems with WebSockets in the beginning, saying that I needed authentication. In the end it was the WebSocket library I used that caused the problem it added ā€œOrigin: file://ā€ to the upgrade message and that causes the problem I got.
So it might be worth checking the http header to see if anything there is causing your auth problem. Even if non of the audio products are using the authentication the functionality, is there in the backend and can cause unexpected errors if trigged.

Finally made it work on my Sony Bravia KDL-48W600B! Iā€™m still very new at this so if thereā€™s anything else you need let me know and Iā€™ll try to post it. I just mapped the power, volume slider and mute switches for now and theyā€™re all working.

Transform:

*AD=AAAAAgAAABoAAAA7Aw%3D%3D
ActionMenu=AAAAAgAAAMQAAABLAw%3D%3D
acTVila=AAAAAgAAABoAAAByAw%3D%3D
Analog2=AAAAAQAAAAEAAAA4Aw%3D%3D
Analog=AAAAAgAAAHcAAAANAw%3D%3D
Analog?=AAAAAgAAAJcAAAAuAw%3D%3D
AnalogRgb1=AAAAAQAAAAEAAABDAw%3D%3D
AppliCast=AAAAAgAAABoAAABvAw%3D%3D
Assists=AAAAAgAAAMQAAAA7Aw%3D%3D
Audio=AAAAAQAAAAEAAAAXAw%3D%3D
AudioMixDown=AAAAAgAAABoAAAA9Aw%3D%3D
AudioMixUp=AAAAAgAAABoAAAA8Aw%3D%3D
AudioQualityMode=AAAAAgAAAJcAAAB7Aw%3D%3D
Blue=AAAAAgAAAJcAAAAkAw%3D%3D
BS=AAAAAgAAAJcAAAAsAw%3D%3D
BSCS=AAAAAgAAAJcAAAAQAw%3D%3D
ChannelDown=AAAAAQAAAAEAAAARAw%3D%3D
ChannelUp=AAAAAQAAAAEAAAAQAw%3D%3D
ClosedCaption=AAAAAgAAAKQAAAAQAw%3D%3D
Component1=AAAAAgAAAKQAAAA2Aw%3D%3D
Component2=AAAAAgAAAKQAAAA3Aw%3D%3D
Confirm=AAAAAQAAAAEAAABlAw%3D%3D
CS=AAAAAgAAAJcAAAArAw%3D%3D
CursorDown=AAAAAgAAAJcAAABQAw%3D%3D
CursorLeft=AAAAAgAAAJcAAABNAw%3D%3D
CursorRight=AAAAAgAAAJcAAABOAw%3D%3D
CursorUp=AAAAAgAAAJcAAABPAw%3D%3D
Ddata=AAAAAgAAAJcAAAAVAw%3D%3D
DeleteVideo=AAAAAgAAAHcAAAAfAw%3D%3D
DemoMode=AAAAAgAAAJcAAAB8Aw%3D%3D
DemoSurround=AAAAAgAAAHcAAAB7Aw%3D%3D
Digital=AAAAAgAAAJcAAAAyAw%3D%3D
DigitalToggle=AAAAAgAAAHcAAABSAw%3D%3D
Display=AAAAAQAAAAEAAAA6Aw%3D%3D
DOT=AAAAAgAAAJcAAAAdAw%3D%3D
Down=AAAAAQAAAAEAAAB1Aw%3D%3D
DpadCenter=AAAAAgAAAJcAAABKAw%3D%3D
DUX=AAAAAgAAABoAAABzAw%3D%3D
Eject=AAAAAgAAAJcAAABIAw%3D%3D
Enter=AAAAAQAAAAEAAAALAw%3D%3D
EPG=AAAAAgAAAKQAAABbAw%3D%3D
Exit=AAAAAQAAAAEAAABjAw%3D%3D
Favorites=AAAAAgAAAHcAAAB2Aw%3D%3D
FlashMinus=AAAAAgAAAJcAAAB5Aw%3D%3D
FlashPlus=AAAAAgAAAJcAAAB4Aw%3D%3D
FootballMode=AAAAAgAAABoAAAB2Aw%3D%3D
Forward=AAAAAgAAAJcAAAAcAw%3D%3D
GGuide=AAAAAQAAAAEAAAAOAw%3D%3D
Green=AAAAAgAAAJcAAAAmAw%3D%3D
Hdmi1=AAAAAgAAABoAAABaAw%3D%3D
Hdmi2=AAAAAgAAABoAAABbAw%3D%3D
Hdmi3=AAAAAgAAABoAAABcAw%3D%3D
Hdmi4=AAAAAgAAABoAAABdAw%3D%3D
Help=AAAAAgAAAMQAAABNAw%3D%3D
Home=AAAAAQAAAAEAAABgAw%3D%3D
iManual=AAAAA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%2BAw%3D%3D
PictureMode=AAAAAQAAAAEAAABkAw%3D%3D
PictureOff=AAAAAQAAAAEAAAA%2BAw%3D%3D
Play=AAAAAgAAAJcAAAAaAw%3D%3D
PopUpMenu=AAAAAgAAABoAAABhAw%3D%3D
Power OFF=AAAAAQAAAAEAAAAvAw%3D%3D
Power ON=AAAAAQAAAAEAAAAuAw%3D%3D
Power=AAAAAQAAAAEAAAAVAw%3D%3D
PowerOff=AAAAAQAAAAEAAAAvAw%3D%3D
Prev=AAAAAgAAAJcAAAA8Aw%3D%3D
ProgramDescription=AAAAAgAAAJcAAAAWAw%3D%3D
RakurakuStart=AAAAAgAAAHcAAABqAw%3D%3D
Rec=AAAAAgAAAJcAAAAgAw%3D%3D
Red=AAAAAgAAAJcAAAAlAw%3D%3D
Return=AAAAAgAAAJcAAAAjAw%3D%3D
Rewind=AAAAAgAAAJcAAAAbAw%3D%3D
Right=AAAAAQAAAAEAAAAzAw%3D%3D
SceneSelect=AAAAAgAAABoAAAB4Aw%3D%3D
SEN=AAAAAgAAABoAAAB9Aw%3D%3D
ShopRemoteControlForcedDynamic=AAAAAgAAAJcAAABqAw%3D%3D
Sleep=AAAAAQAAAAEAAAAvAw%3D%3D
SleepTimer=AAAAAQAAAAEAAAA2Aw%3D%3D
Social=AAAAAgAAABoAAAB0Aw%3D%3D
Stop=AAAAAgAAAJcAAAAYAw%3D%3D
SubTitle=AAAAAgAAAJcAAAAoAw%3D%3D
SyncMenu=AAAAAgAAABoAAABYAw%3D%3D
Teletext=AAAAAQAAAAEAAAA%2FAw%3D%3D
TenKey=AAAAAgAAAJcAAAAMAw%3D%3D
Theater=AAAAAgAAAHcAAABgAw%3D%3D
TopMenu=AAAAAgAAABoAAABgAw%3D%3D
TrackID=AAAAAgAAABoAAAB%2BAw%3D%3D
Tv=AAAAAQAAAAEAAAAkAw%3D%3D
Tv_Radio=AAAAAgAAABoAAABXAw%3D%3D
TvAnalog=AAAAAQAAAAEAAAA4Aw%3D%3D
TvAntennaCable=AAAAAQAAAAEAAAAqAw%3D%3D
TvInput=AAAAAQAAAAEAAAAlAw%3D%3D
TvPause=AAAAAgAAABoAAABnAw%3D%3D
TvPower=AAAAAQAAAAEAAAAVAw%3D%3D
TvSatellite=AAAAAgAAAMQAAABOAw%3D%3D
Up=AAAAAQAAAAEAAAB0Aw%3D%3D
Video1=AAAAAQAAAAEAAABAAw%3D%3D
Video2=AAAAAQAAAAEAAABBAw%3D%3D
VolumeDown=AAAAAQAAAAEAAAATAw%3D%3D
VolumeUp=AAAAAQAAAAEAAAASAw%3D%3D
WakeUp=AAAAAQAAAAEAAAAuAw%3D%3D
Wide=AAAAAgAAAKQAAAA9Aw%3D%3D
WirelessSubwoofer=AAAAAgAAAMQAAAB%2BAw%3D%3D
WriteChapter=AAAAAgAAAHcAAABsAw%3D%3D
Yellow=AAAAAgAAAJcAAAAnAw%3D%3D

@nick_woodforth

Sounds like you need to delete your cache/temp directories and start over again since it sounds like you have bigger openhab issues than just this binding.

@freke

Absolutely kills me when you say ā€œā€¦looked into the docs I have about ā€¦ā€ - would have loved to see those resources! The authentication issues I was having is because I didnā€™t know about the websockets until now (hadnā€™t really looked at what that port was doing - so never noticed the websocket protocol) and I was trying to figure out how to authenticate when I was missing the ā€œactRegisterā€ method. However - with the websocket protocol - I believe I should be able to get those working.

Would you be able to state whether ALL devices that implement webscalar service will have a websocket available (and thus can change everything over to a websocket rather than http posts)?

Thanks,
Tim

@tmrobert8 the short answer is, I donā€™t know.
From the sources I can see my guess is there is some older products that donā€™t have websockets support, it looks like the first versions of webscalar didnā€™t support websockets, but I donā€™t know.

To complicate it even more it is not certain that all methods is present in both even if both are supported. The only one I know of, is switchNotification, that is only pressent for websockets.

If ā€œactRegisterā€ method is missing no authentication is needed for that product :wink:
If it is present some functions will need authentication for both websockets and http.

@freke

Thatā€™s very helpful - thanks!

Can someone help?

Ive added the binding but in the paper UI there is no option to discover devices.

Thanks