Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use pre shared key instead of the more complicated cookie method
Thanks StefanPuntNL and wennes. Fixes #5.
- Loading branch information
Showing
5 changed files
with
52 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
The usage of these scripts should be relatively straight forward. If you want more details, please refer to the corresponding blog post: https://blog.yrden.de/2014/11/14/remote-control-bravia-tvs-with-authentication.html | ||
## Setup | ||
|
||
You need to set your TV to use a pre-shared key. | ||
|
||
1. Navigate to: [Settings] → [Network] → [Home Network Setup] → [IP Control] | ||
2. Set [Authentication] to [Normal and Pre-Shared Key] | ||
3. There should be a new menu entry [Pre-Shared Key]. Set it to **0000**. If you choose anything else, you need to change the PSK in the `send_command.sh` script. | ||
|
||
## Usage | ||
|
||
1. Run `print_ircc_codes.sh TV_IP_HERE` to get an overview of the commands possible. | ||
2. Run `send_command.sh TV_IP_HERE ONE_COMMAND_HERE`. A command looks like `AAAAAQAAAAEAAABgAw==`. | ||
3. The TV will execute the command and immediately return. If you want to navigate through menus, you'll have to manually `sleep` until the TV has finished the command/animation. | ||
|
||
See `example_goto_media_player.sh` on how to build your automations. | ||
|
||
Have fun! | ||
|
||
### More detailed explanation | ||
|
||
The original blog post describes how to figure this out in general: | ||
https://blog.yrden.de/2014/11/14/remote-control-bravia-tvs-with-authentication.html | ||
|
||
StefanPuntNL figured out how to use it with a Pre-Shared-Key, which is much simpler: | ||
https://www.domoticz.com/forum/viewtopic.php?t=8301 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
# Note: this is only useful when you want to build an APP that also supports | ||
# authentication via cookie. The cookie method loses validity after a | ||
# couple of weeks, so so there is probably some refresh method required | ||
# which is not detailed here. | ||
|
||
if [ "$1" = "" ] || [ "$2" = "" ]; then | ||
echo "Usage: $0 <TV_IP> <IRCC_COMMAND>" | ||
exit 1 | ||
fi | ||
|
||
if ! [ -e 'auth_cookie' ]; then | ||
echo 'auth_cookie not found. Run ./auth.sh first.' | ||
exit 1 | ||
fi | ||
|
||
cmd="<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body><u:X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>$2</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" | ||
|
||
curl --silent -XPOST http://$ipaddress/sony/IRCC -d "$cmd" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -H"Cookie: $cookie" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters