Sony Devices Binding

openhab2
Tags: #<Tag:0x00007fae04294be0>

(Tim Roberts) #1

The next binding I need to write is a Sony Bravia TV - unlike [SOLVED] Sony BRAVIA & TCP Binding, I don’t want a simple remote binding. I want/need a full two-way binding to react to things done directly on the tv. Looking at the protocol document - seems like this is a pretty easy binding. In addition, I’ll probably allow the binding to handle my sony bluray player as well (which is next on the list).

However - before I start this, I noticed there is a pull request for another Sony Bravia TV binding (#749). This pull request is even a simpler binding (power and maybe change source) and totally would be useless for my situation. Unfortunately it’s already written and in the wings…

So - what do I do?

Do I wait until that pull request has been approved then go in an (?ruthlessly?) rewrite it for a full binding?
Or do I create a new binding that will handle what I do (#749 ID is “sonytv” - I could make my a “sony” that has a “tv” and “bluray” player things in it) and we have a confusing duplicate?
Or does someone have another approach to this that I can’t think of?


Exec Binding to control Sony Bravia
Multiple Actions with on Button
(Rich Koshak) #2

You might add a comment on that PR pointing back here so those people involved with that binding are alerted to the discussion.


(neo) #3

Hi Tim
I haven’t been able to get it to work properly. I can turn the tv off,but, can’t turn it on. Having only power on and input function is quite limiting for me.

Work on a full function Sony binding would be a welcome addition!


(AV Home Auto) #4

I can help, and learn in the process.

I had implemented most of the functions using the TCP binding. not quite professional, but it works.


(neo) #5

Wow! I disagree. That looks very professional. :slight_smile:


(Tim Roberts) #6

I coded it all up last night and am in local testing phase today. An interesting tidbit - the API document shows that commands are a 4 letter code. Being the inquisitive person I am - I quickly scanned the TV for all 4 letter codes and found a number of commands that aren’t documented (example: DHPT, DHPU and DRSS - all three return some numeric value). After I’m done testing locally - I’ll want some public testers to try it out before issuing a pull request. While that is happening, I’ll probably investigate what those commands potentially do/return.


(neo) #7

Hi Tim
Great work. I’m happy to help test if required.


(Garry McCandless) #8

I’ll be more than happy to assist with any testing, I’m currently using a very basic setup using a bash script and tcp binding. So anything that allows two way communication would be very useful to have.

I am however still only running on 1.8.3, as I’m still learning how OH fits together. The Wife uses the setup I have in place right now and has accepted this solution. It’s stable and easy. SO I’m hopefully the binding is cross compatible.


(Tim Roberts) #9

I have no idea if this will work on 1.8.3 (I doubt it since it’s written for openhab2) - maybe someone else can chime in.

What’s the proper way to share a test binding jar? Attach to forum? Create a pull request? Exchange email addresses? Push to my github? uh???

Thanks,
Tim


(Kai Kreuzer) #10

Correct.

What’s the proper way to share a test binding jar?

First create the PR and than attach the jar to that PR (in a comment by changing the file ext to zip, since jar is not allowed by Github).


(Jack M) #11

I have a couple of Sony Blu Ray players. I can test when you have something for these.


(AV Home Auto) #12

I’m in!


(Hallo Ween) #13

I have a Sony Bravia TV from 2010. It is called Sony Bravia KDL-42EX500.

Can i use this binding with my tv too or is this only workiung with newer tv?


(Tim Roberts) #14

I’ve just posted the pull request for this PR-1232 and you can find the zip file on that post. This is a testing implementation and could (probably) does contain some bugs. I’d love to get your feedback and good luck!

Tim


(Tim Roberts) #15

I don’t know really - but I’m going to guess no. I quickly looked at the owners manual and it doesn’t appear to have a network port (wired or wireless) does it? This binding is strictly and IP based binding and without a network port - it wouldn’t be able to communicate to it. If your’s does have a network port - then check the settings to see if you can enable “Simple IP Control”. If you can, then it should work. If the setting doesn’t exist - I’d doubt this will work for you.


(Tim Roberts) #16

I’m going to start looking at the bluray player APIs (if they exist) - could you post your model numbers (and I’ll look for them as well)


(Hallo Ween) #17

My TV has a network port, i will give it a try.


(Jack M) #18

My Blurays are BDP-BX320 and BDP-BX520.


(farhan) #19

tried the binding with Sony Bravia KDL50W800C and it works great, thanks.
got errors with Broadcast and MAC Address though

13:03:20.506 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error broadcast address
13:03:20.570 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error mac address

EDIT:

also, when the TV is off, there are errors about audio volume… even when Volume channel is disabled

15:14:33.639 [INFO ] [marthome.event.ItemStateChangedEvent] - sony_bravia_Home_power changed from ON to OFF
15:14:33.713 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error issuing audio volume
15:14:33.913 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error issuing audio volume
15:15:03.888 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error issuing audio volume
15:15:33.912 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error issuing audio volume
15:16:03.890 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error issuing audio volume
15:16:33.889 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error issuing audio volume
15:17:03.903 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error issuing audio volume
15:17:33.959 [WARN ] [.sony.internal.bravia.BraviaProtocol] - Error issuing audio volume


(Tim Roberts) #20

Farhanito,

For broadcast/mac address to work - you need to set the netInterface configuration for the thing. For my X830c, it’s either eth0 (for wired) or wlan0 (for wireless). The addon defaults to eth0 if none was specified. If you are connecting wirelessly, try specifying “wlan0” for that config setting. If neither of those works - try a few variants (eth1, eth2 or wlan1, wlan2 if wired or wireless). If none of those works, either your TV doesn’t support them or they use some weird interface name (ath0?). At any rate, since none of this is documented it’s kinda guess work. Play with them and report back your results if you would.

As for the audio volume (and some of the others as well), the next version will be a bit smarter in handling those. When the TV is off, many of the commands return errors (likewise, channel commands return errors when using hdmi). The current version of this binding just blindly submits everything regardless of state.