Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

gerard33/sony-bravia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This plugin is no longer maintained.

Sony Bravia TV - Domoticz Python plugin

Domoticz Python plugin for Sony Bravia TV

This plugin uses the Sony Bravia RC API by Antonio Parraga Navarro. Also a lot of inspiration came from this post by StefanPuntNL.

Table of Contents

Information

The plugin will show information from your Sony Bravia TV in Domoticz. It will work on Sony Bravia models 2013 and newer. Also tested on a number of Android models, see the list below. When using an Android you can enter 'Android' in the MAC field, so you can also switch the TV on via Domoticz.

Information on the TV channel and program are only showed when you use the built-in TV tuner. Otherwise for example HDMI1 will be shown.

The volume slides shows the volume of the built-in speakers. If you have an amplifier attached to your TV, that volume is not shown. You can use the on/off button of the slider switch though to mute/unmute the TV, also if you have the TV connected to an amplifier.

The remote control in the Status switch gives some extra options. See the screenshot below for extra info on some of the buttons.

Sony Bravia plugin instructions

Works with Pre-Shared Key (PSK). The default PSK you can use is 'sony', but you can change the PSK to something else. If you change it, remember to also change the PSK in the Domoticz hardware page.

TV settings

  • Enable remote start on your TV: [Settings] => [Network] => [Home Network Setup] => [Remote Start] => [On]

  • Enable pre-shared key on your TV: [Settings] => [Network] => [Home Network Setup] => [IP Control] => [Authentication] => [Normal and Pre-Shared Key]

  • Set pre-shared key on your TV: [Settings] => [Network] => [Home Network Setup] => [IP Control] => [Pre-Shared Key] => sony

  • Give your TV a static IP address, or make a DHCP reservation for a specific IP address in your router.

  • Determine the MAC address of your TV: [Settings] => [Network] => [Network Setup] => [View Network Status]

The IP address, PSK and MAC address need to be entered in the Domoticz hardware page, see screenshot below.

Domoticz settings

See this link for more information on the Domoticz plugins. This plugin works with the old and new version of the Python framework in Domoticz.

  • SSH to your server on which Domoticz is installed

  • Enter the following commands

cd domoticz/plugins
git clone https://github.com/gerard33/sony-bravia.git
  • When updating to the latest version on Github enter the following commands
cd domoticz/plugins/sony-bravia
git pull
  • Restart the Domoticz service
sudo service domoticz.sh restart
  • Now go to Setup, Hardware in your Domoticz interface. There you add Sony Bravia TV.

Make sure you enter all the required fields.

Field Information
IP address Enter the IP address of your TV (see instructions above how to find the IP address, also make sure it is static)
Pre-shared key Enter the Pre-shared key here (default is sony). If you have issues using a PSK you can try to use the cookie method at the cookie branch, thanks to markcame for implementing this
MAC address Enter the MAC address of your TV (see instructions above how to find the MAC address). If you have an Android TV you can enter 'Android' (without quotes) in the MAC field. This way the plugin will use another method to switch on the TV.
Volume bar Option to enable or disable a Domoticz device for the volume bar, this can be used to control the volume of the TV, but only for the built-in speakers of the TV
Update interval Enter the update interval in seconds, this determines with which interval the plugin polls the TV (must be between 10 and 30 seconds)
Debug When set to true the plugin shows additional information in the Domoticz log

After clicking on the Add button the devices are available in the Switches tab.

Screenshots

tv tv2

sony_tv_control_channel

tv3

tvhw

remote_functions

Testing the plugin

To do some easy testing with the plugin there is a localtest.py script that can be run from the command line. Make sure you enter the IP address and PSK of your TV in localtest.py before executing it. After that you can check if your TV works with the plugin.

cd domoticz/plugins/sony-bravia
./localtest.py

This will print some information regarding the TV to the console.

Thanks to ffes for localtest.py which is part of his Buienradar Python script.

Confirmed working on the following TV´s

  • KDL-50W829B

  • KDL-42W705B

  • KDL-55W805C

  • KD-55X9005B

  • KDL-42W805A --> with the use of cookies, check this for more information

  • KDL-60W605B

  • KD-49XD8305 Android

  • KD-55X8509C Android

  • KD-55SD8505 Android

  • KD-55XD8505 Android

  • KD-55XD8005 Android

  • KDL-50W755c Android