Difference between revisions of "Install Bravia"

From xPL
Jump to: navigation, search
(Install xPL script)
(Install xPL screen controller)
Line 78: Line 78:
 
  $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-screen.loungeScreen -c screen.basic power=on
 
  $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-screen.loungeScreen -c screen.basic power=on
 
  $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-screen.loungeScreen -c screen.basic input=hdmi4
 
  $SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-screen.loungeScreen -c screen.basic input=hdmi4
 +
 +
= Launch the scripts at startup =
  
 
[[Category: all]] [[Category: install]] [[Category:xPL]]
 
[[Category: all]] [[Category: install]] [[Category:xPL]]

Revision as of 22:04, 1 April 2018

The Sony Bravia series are powered by Android.

Different python packages allow to control the TV from a PC:

Set-up the TV

Controlling the TV requires a mix of its:

  • IP address
  • device name
  • device id
  • PIN (entered at setup time)
  • Pre-Shared Key (PSK)

Test the script

Install pip if it isn't done yet:

su
which pip
easy_install pip
pip install requests
exit

Download Bravia Console.

su control
SCRIPTS_DIR='/home/control/Documents/Controls/'
wget https://github.com/darkosancanin/bravia_console/archive/master.zip -O ~/Downloads/bravia_console.zip
unzip ~/Downloads/bravia_console.zip -d /tmp/
cp /tmp/bravia_console-master/bravia_console.py $SCRIPTS_DIR/
chmod 775 $SCRIPTS_DIR/bravia_console.py
$SCRIPTS_DIR/bravia_console.py
  > exit

The console interface shows how to set-up the Pre-Shared Key (PSK). Edit bravia_console.py to match the script to your PSK:

self.psk = "0000"

Connect to the TV:

./bravia_console.py
  > show info
  > show commands
  > hdmi1
  > poweroff
  > tvpower

Change input source:

./bravia_console.py -c hdmi2 > /dev/null
./bravia_console.py -c hdmi1 > /dev/null

Change some settings

Remove "Idle TV standby":

Home -> Settings -> Power -> Eco -> Idle TV standby -> Off

Install xPL screen controller

Download the screen controller script to xPL scripts directory:

su control
SCRIPTS_BASE_DIR=/home/control/Documents/Controls
cd $SCRIPTS_BASE_DIR
wget http://www.dspc.ch/xPL/Downloads/xpl-screen-bravia.pl
chown control:users *.pl
chmod 775 *.pl

Test the screen controller:

su control
SCRIPTS_BASE_DIR=/home/control/Documents/Controls
$SCRIPTS_BASE_DIR/xpl-screen-bravia.pl -v -n loungeScreen

Open another terminal window and test the commands:

su control
SCRIPTS_BASE_DIR=/home/control/Documents/Controls
$SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-screen.loungeScreen -c screen.basic power=off
$SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-screen.loungeScreen -c screen.basic power=on
$SCRIPTS_BASE_DIR/xpl-send.pl -d dspc-screen.loungeScreen -c screen.basic input=hdmi4

Launch the scripts at startup