Sony TV Network Remote Control Plugin

Questions and comments specific to a particular plugin should go here.

Sony TV Network Remote Control Plugin

Postby tobyg » Sat Mar 15, 2014 3:00 am

I've created a plugin that interfaces directly with the IP interface on compatible Sony Bravia TVs. I've only tested this on my 2013 model, although I believe this may work on 2012 and other models with an ethernet interface.

To install the plugin, copy the folder in the attached .zip file into the "plugins" folder under your EventGhost installation folder. Using a text editor, you must change the "IP_ADDRESS" variable in the plugin file (__init__.py) to match your TV's IP address. Thus, you should also set your TV to use a static IP address (or set your router to give the TV the same address all the time).

You can then add actions to an EventGhost macro corresponding to remote control buttons. There is also a "SendCommand" action by which you can send any IRCC code, which may be useful if your TV uses different codes.

Note that this cannot turn on the TV, since the network interface turns off when the TV is on standby. (The TV can be turned on using the WOL feature of compatible TVs, or using a CEC interface, such as RCAware.)

This is just an early version, so any improvements/suggestions are welcome.

Some of this code was based off the RokuNetworkControl plugin, so thanks to barnabas1969!
Attachments
SonyTVNetworkRemote.zip
Sony TV Network Remote Control Plugin
(2.83 KiB) Downloaded 285 times
tobyg
 
Posts: 8
Joined: Wed May 13, 2009 12:54 pm

Re: Sony TV Network Remote Control Plugin

Postby Medienuser » Sat Feb 14, 2015 7:56 am

Hello Tobyg!
I´d like to use such a plugin for my Sony Receiver DA5800ES. Do you have any ideas where I can find some information how to get in contact with the Ip Interface of the Receiver? Sony provides an iPhone app so there must be a way to control...
Any idea will be helpful :-)
Thanks and greetings!
Medienuser
 
Posts: 7
Joined: Mon Jun 02, 2014 1:00 am

Re: Sony TV Network Remote Control Plugin

Postby tobyg » Sat Feb 28, 2015 6:43 pm

Medienuser,

Unfortunately, I only have experience with the TV. I agree that if there is an iPhone app then there should be a way to get it working.
tobyg
 
Posts: 8
Joined: Wed May 13, 2009 12:54 pm

Re: Sony TV Network Remote Control Plugin

Postby 3000 » Sat Aug 08, 2015 7:43 pm

tobyg: I wanna thank you for your excellent work! This is working perfectly with my Sony Bravia KD-65X9005A.
sign my petition to save a 28-year-old young mother who is fighting Stage 4 cancer: https://www.change.org/p/help-cancer-patients-like-gemma-nuttall-by-making-immunotherapy-available-on-the-nhs
3000
 
Posts: 37
Joined: Fri Aug 07, 2015 3:49 pm

Re: Sony TV Network Remote Control Plugin

Postby paseant » Fri Feb 12, 2016 10:07 am

Thanks tobyg for your work.

I have a Sony X850, one of the 2015 Series 4k TV's. I have had some troubles making the plugin work so here are some comments in case someone finds it useful.

IP control includes access security. It seems to need a cookie, or auth first before it will work. The controlling device has to be registered with the TV and after registration the TV is using HTTP cookie basic authentication with each packet. Likely the cookie is different for each device - randomly generated at authentication and with a limited valid lifetime. See "http://www.openremote.org/display/forums/Sony+TV+HTTP+control" for great info. Using the method described by Michael Tout so you can also get the particular codes of your TV set.

Alternatively you can use a preshared key and this is what got the plugin working for me. Adjust the TV settings as:

Code: Select all
Settings
  Network
    Home network setup
      IP Control
        Authentication
          Normal & Preshared Key
          Preshared Key
            1111 <- just choose one>
          Simple IP Control
            On


In the plugin change the ip address as indicated by tobyg and add the line "'X-Auth-PSK': '1111'," to headers:

Code: Select all
headers = {
  'X-Auth-PSK': '1111',
  'User-Agent': 'TVSideView/2.0.1 CFNetwork/672.0.8 Darwin/14.0.0', ...


where 1111 is your preshared key.
paseant
 
Posts: 21
Joined: Sat Jan 26, 2008 1:06 am

Re: Sony TV Network Remote Control Plugin

Postby HTPCanwender » Fri Feb 12, 2016 9:01 pm

The modyfied plugin operates well with my Sony KD-49X830 4k Android TV. It would be nice if someone could add a configuration menu to the plugin.
HTPCanwender
 
Posts: 32
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Sony TV Network Remote Control Plugin

Postby blaher » Sun Feb 21, 2016 12:37 am

paseant wrote:Thanks tobyg for your work.


And thank you! I had been using Curl to do it, but this is far more elegant. I'll post my EG config with the updated codes for my TV when I get a chance.

I wonder if there's a way to 'ping', or send a command to discover whether the TV is on? If not I'll just use the power on/off commands as triggers to enable/disable folders for quicker switching, i.e. on startup you need a delay before switching inputs, running programs, etc., but not if it's on already.

Cheers!
blaher
Experienced User
 
Posts: 463
Joined: Thu Nov 17, 2011 1:27 am

Re: Sony TV Network Remote Control Plugin

Postby blaher » Mon Feb 22, 2016 1:20 am

I've added my .ini with codes, and the pre-shared key of "1111" for a 2015 Bravia TV, a KDL65W850C, because the codes are probably more up to date, and it was a bit of a hassle formatting them from the TV's "getRemoteControllerInfo" dump. But after a bit of Excel to duplicate just the names, and Notepad ++'s keyboard macro recorder I got there in the end. Hopefully this will save someone else that hassle.

Setting the key on the TV, and changing the IP in the attached .ini should be all you need to do.

Edit: I forgot to mention that with the newer models you can wake them up over the network now, rather than relying on a separate WOL packet, as mentioned in the first post by tobyg.

Edit: New version posted below.
Last edited by blaher on Mon Apr 04, 2016 1:37 am, edited 2 times in total.
blaher
Experienced User
 
Posts: 463
Joined: Thu Nov 17, 2011 1:27 am

Re: Sony TV Network Remote Control Plugin

Postby Intruder » Sun Mar 06, 2016 4:14 pm

Thank you so much for the plugin, I have become really desperate trying to write my own python script. It always returned an "Invalid action" when I tried to send IRCC Codes.
Thanks again! :D
Intruder
 
Posts: 2
Joined: Thu Jan 01, 2015 10:10 pm

Re: Sony TV Network Remote Control Plugin

Postby blaher » Sat Mar 12, 2016 5:07 am

HTPCanwender wrote:It would be nice if someone could add a configuration menu to the plugin.


Here you go, this version has a configuration box for both the TV's IP, and the pre-shared key. Hope it helps someone.

I've never programmed anything like this before, so the code probably looks weird to others, but it seems to work! :)

Edit: it also adds a list of all the possible codes as macros, as it's easier to delete the tree if you don't need them, than to do them one by one, if you do.
Attachments
SonyNetworkRemote v0.0.2.zip
Plugin with configuration box.
(3.28 KiB) Downloaded 230 times
blaher
Experienced User
 
Posts: 463
Joined: Thu Nov 17, 2011 1:27 am

Re: Sony TV Network Remote Control Plugin

Postby HTPCanwender » Mon Apr 04, 2016 8:34 pm

Thank you.
HTPCanwender
 
Posts: 32
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Sony TV Network Remote Control Plugin

Postby 3000 » Mon May 15, 2017 11:42 am

hi there, is it also possible to turn ON the TV?

Thank you!!
sign my petition to save a 28-year-old young mother who is fighting Stage 4 cancer: https://www.change.org/p/help-cancer-patients-like-gemma-nuttall-by-making-immunotherapy-available-on-the-nhs
3000
 
Posts: 37
Joined: Fri Aug 07, 2015 3:49 pm

Re: Sony TV Network Remote Control Plugin

Postby kgschlosser » Mon May 15, 2017 12:39 pm

In the first post it states you cannot turn the TV on. It is the same for Samsung. When the TV gets powered off it also turns off the wifi/wired network card inside of it. You can either use a serial connection. Or some kind of ir blaster. What I have done myself is I used a microcontroller called an esp8266 which costs about 6 dollars USD. An it led about .50 USD and an old cell phone charger as a power supply. And a USB cable to plug into the TV. The microcontroller has WiFi built in and is pretty easy to connect to EG to tell it to send the it to turn the TV on. I went alittle further with it by opening up the TV and mounting the IR led inside right next to the eye. I didn't want to see the wires attached to the front of the TV. The USB cable I used to tell if the TV is on or off. You may need a 10k ohm pulldown resistor. The USB ports only get powered up when the TV is on. This is a surefire way to get the state of the TV. Also makes a nice way to shut down your whole system in the event you lose your remote in the sofa and don't have the time to look for it. Because EG will know that the TV lost power without you asking via a remote and can issue the commands to either turn on or off the other pieces. Simply by pressing the power button on the TV it's self.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2712
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Sony TV Network Remote Control Plugin

Postby zian » Mon May 15, 2017 1:02 pm

3000 wrote:tobyg: I wanna thank you for your excellent work!


Heck yes !!!

Medienuser wrote:Hello Tobyg!
I´d like to use such a plugin for my Sony Receiver...
Thanks and greetings!


Me too.
I guess will have to wait a while Medien.
Keep Wishing I Will.
eventghost.net
Be there or be square.
User avatar
zian
Site Admin
 
Posts: 485
Joined: Wed Jun 24, 2009 3:54 pm

Re: Sony TV Network Remote Control Plugin

Postby 3000 » Mon May 15, 2017 1:10 pm

I used to do it via an HDMI-CEC Adapter. I thought maybe I could eliminate that. But the alternative is too complicated for me.

But thank you for your answer! Always a help :)

edit: still thinking about your answer:

I have an HTPC. Can I install the esp8266 onto the mainboard and connect it via usb to my Sony TV? Not sure how this would work ...
sign my petition to save a 28-year-old young mother who is fighting Stage 4 cancer: https://www.change.org/p/help-cancer-patients-like-gemma-nuttall-by-making-immunotherapy-available-on-the-nhs
3000
 
Posts: 37
Joined: Fri Aug 07, 2015 3:49 pm

Next

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 4 guests