Sony TV Remote

Last Updated on 2017-02-01

Recent Sony Bravia TVs offer a web based control mechanism which can be used to control the TV.

Here’s some code that provides a web page with buttons that activate functions on the TV.

It allows for custom button creation and for quick access to specific channel numbers.
And since it is just a web page (HTML with Javascript), it works on computers, smartphones,
and tablets.

Here’s an online working version:
Online Sony TV Web Remote.
That page also has the Help tab with more information:
Note that the link above is actually a working example, and it will work if you are accessing the page from a computer which can also access your TV. So visiting the page from your home network that has both the computer (or smartphone or tablet) and the TV visible to each other will allow you to control your TV from the link above!

Another way to use this package is to download it locally and then visit the sony-tv-html page in Firefox or Chrome (it does not work in Microsoft Edge).

The Help tab on the Online Sony TV Web Remote has more details on various ways to download and install the package.
It can also be installed as web extension, though that may not be necessary and may be more complicated than just unpacking the source and browsing to the local web page: file:///.../sony-tv.html URL and see if it works.

Source Code
GitHub sony-tv-remote link can be used to browse all source files including the README with more details.

Download the code as a ZIP archive:

(This has only been tested on Firefox and Chrome. It does not work on Microsoft Edge which does not support the standard Javascript code used here.)

Using this requires the TV to support IRCC control (Sony Bravia TV IR-like-control-commands), have a fixed IP address, and allow remote access using a pre-shared key. TV should also support CORS (cross-origin resource sharing) to avoid Javascript same-origin policy issues. Most (all?) Sony Bravia TVs in 2016 seem to provide this support.

Screenshots of Version 1.2 (Jan 2017) on the desktop and on an Android phone:

While it is simpler and easier to use this as a normal web page, it can be used as a web extension too.
It can be manually downloaded by right-clicking this link: Firefox Add-on Sony TV Web Page Remote.
Then use the Firefox Menu -> Add-ons -> [Settings Gear Icon] -> Install Add-on From File to load the extension.
Once the extension is loaded, it will show up as an television icon on the browser toolbar.
Clicking on the extension brings up the web page with the remote control buttons.