Hi has anyone got a sony str dn 1050 that can be controlled by Domoticz?
I want to be able to send a command to be able to switch input ie radio and another command to play a specific track off my network.
Thanks
Sent from my iPhone using Tapatalk - now Free
sony str dn1050
Moderator: leecollings
-
- Posts: 4
- Joined: Saturday 05 March 2016 11:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: sony str dn1050
I'm interested in this solution as well. Now i'm controlling the AV via ip commands and CEC however this is rather devious. if anyone could help me/us to find out how this can be implemented that would be wonderfull. I already found some bits and pieces but can't seem to fit them together.
-
- Posts: 4
- Joined: Saturday 05 March 2016 11:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: sony str dn1050
With some help from the LUA script for Sony Bravia TV forum i came up with this script. When external controls are enabled on the receiver you're able to send at least a few commands. Next thing is to get some feedback like actual volume, function.
Code: Select all
#!/bin/bash
# Fill in
SonyAVRIP="YourIPAddress"
set -e
cd $(dirname $0)
if [ "$1" = "" ]; then
echo "Usage: $0 <COMMAND>"
exit 1
fi
declare -A commandmap
commandmap[PowerOff]="AAAAAgAAADAAAAAVAQ=="
commandmap[Mute]="AAAAAgAAADAAAAAUAQ=="
commandmap[MuteOn]="AAAAAwAADRAAAAAgAQ=="
commandmap[MuteOff]="AAAAAwAADRAAAAAhAQ=="
commandmap[Confirm]="AAAAAgAAADAAAAAMAQ=="
commandmap[Home]="AAAAAgAAADAAAABTAQ=="
commandmap[Display]="AAAAAgAAADAAAABLAQ=="
commandmap[Return]="AAAAAwAAARAAAAB9AQ=="
commandmap[Options]="AAAAAwAAARAAAABzAQ=="
commandmap[FunctionPlus]="AAAAAgAAALAAAABpAQ=="
commandmap[FunctionMinus]="AAAAAgAAALAAAABqAQ=="
commandmap[Play]="AAAAAwAAARAAAAAyAQ=="
commandmap[Pause]="AAAAAwAAARAAAAA5AQ=="
commandmap[Stop]="AAAAAwAAARAAAAA4AQ=="
commandmap[Next]="AAAAAwAAARAAAAAxAQ=="
commandmap[Prev]="AAAAAwAAARAAAAAwAQ=="
commandmap[Shuffle]="AAAAAwAAARAAAAAqAQ=="
commandmap[Repeat]="AAAAAwAAARAAAAAsAQ=="
commandmap[FF]="AAAAAwAAARAAAAA0AQ=="
commandmap[FR]="AAAAAwAAARAAAAAzAQ=="
commandmap[VolumeUp]="AAAAAgAAADAAAAASAQ=="
commandmap[VolumeDown]="AAAAAgAAADAAAAATAQ=="
commandmap[Up]="AAAAAgAAALAAAAB4AQ=="
commandmap[Down]="AAAAAgAAALAAAAB5AQ=="
commandmap[Left]="AAAAAgAAALAAAAB6AQ=="
commandmap[Right]="AAAAAgAAALAAAAB7AQ=="
commandmap[Num1]="AAAAAgAAADAAAAAAAQ=="
commandmap[Num2]="AAAAAgAAADAAAAABAQ=="
commandmap[Num3]="AAAAAgAAADAAAAACAQ=="
commandmap[Num4]="AAAAAgAAADAAAAADAQ=="
commandmap[Num5]="AAAAAgAAADAAAAAEAQ=="
commandmap[Num6]="AAAAAgAAADAAAAAFAQ=="
commandmap[Num7]="AAAAAgAAADAAAAAGAQ=="
commandmap[Num8]="AAAAAgAAADAAAAAHAQ=="
commandmap[Num9]="AAAAAgAAADAAAAAIAQ=="
commandmap[Num0]="AAAAAgAAADAAAAAJAQ=="
commandmap[PureDirect]="AAAAAwAABRAAAAB5AQ=="
IRCC=${commandmap[$1]}
if [ "$IRCC" = "" ]; then
echo "Unkown command $1"
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>$IRCC</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>"
pre="Host: $SonyAVRIP:8080"
url=http://$SonyAVRIP:8080/upnp/control/IRCC
code=$(curl -w "%{http_code}" --silent "$url" -d "$cmd" -H 'Content-Type: text/xml; charset=UTF-8' -H "soapaction: \"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\"" -H "$pre" -H "Connection: Keep-Alive"$
if [ "$code" = "200" ]; then
echo "$1: ✓"
else
echo "$1: Command failed (HTTP_CODE: $code, try running it in a console)"
exit 1
fi
Who is online
Users browsing this forum: No registered users and 1 guest