Page 1 sur 2

Plug-in pour commander tous les appareils Sony connectés

Publié : 15 mars 2018, 13:48
par Saint-Jey
Bonjour à tous,

J'ai vu sur le market qu'il existe un (des) plugin pour piloter les tv sony Bravia mais il me semble qu'un plgin serait intéressant pour piloter tous les appareils connectés Sony.

J'ai fouiné un peu sur github et j'ai trouvé une API qui a l'air de faire cela :
https://github.com/KHerron/SonyAPILib

Malheureusement pour moi (pour vous), je n'ai aucune connaissance en programmation hormis html léger et un peu de visual basic.
Du coup, y aurait-il un développeur généreux pour se pencher sur ce plugin. Je peux réaliser des tests chez moi vu que je possède un Sony BDV-n790 qui est dans la liste.

D'ailleurs en parlant de liste, voici les appareils reconnus par cette api :
LCD TV BRAVIA
2016 model or later:
*KDL-W/WD, KLV-W Series (2016 model) are not compatible with Video & TV SideView. (Except for KDL-W800D/W950D) *You can not install Video & TV SideView app into your Sony's Android TV™.

2015 model
XBR-X94xC series, XBR-X93xC series, XBR-X91xC series, XBR-X90xC series, XBR-X85xC series, XBR-X83xC series, XBR-X80xC series, KD-X94xxC series, KD-X93xxC series, KD-X91xxC series, KD-X90xxC series, KD-X85xxC series, KD-X83xxC series, KD-X80xxC series, KDL-W95xC series, KDL-W85xC series, KDL-W80xC series, KDL-W75xC series, KDL-W70xC series, KDL-W600A series

Please update your TV software to the latest version. For how to update the software.
You can not install Video & TV SideView app into your Sony's Android TV™.
2014 model
XBR-X95xB series, XBR-X90xB series, XBR-X85xB series, KD-X95xxB series, KD-X90xxB series, KD-X85xxB series, KD-X83xxC series, KD-X80xxB series, KDL-W95xB series, KDL-W92xA series, KDL-W90xB series, KDL-W85xB series, KDL-W83xB series, KDL-W8xxB series, KDL-W7xxB series, KDL-W6xxB series, KDL-W5xxA series

2013 model
XBR-X90xA series, XBR-X85xA series, KD-X900xA series, KD-X850xA series, KDL-W95xA series, KDL-W90xA series, KDL-W85xA series, KDL-W80xA series, KDL-W70xA series, KDL-W67xA series, KDL-W65xA series, KDL-W60xA series, KDL-S99xA series

2012 model
XBR-X90x series, KD-X900x series, XBR-HX95 series, KDL-HX95 series, KDL-HX85 series, KDL-HX75 series, KDL-NX65 series, KDL-EX75 series, KDL-EX65 series, KDL-EX55 series, KDL-EX54 series

2011 model
XBR-HX92 series, KDL-HX92 series, KDL-HX82 series, KDL-HX72 series, KDL-NX72 series, KDL-EX72 series, KDL-EX62 series, KDL-EX52 series, KDL-EX42 series, KDL-EX32 series, KDL-CX52 series, KDL-CX40 series

Blu-ray Disc™/DVD Player
UHP-H1, BDP-S6700, BDP-S3700, BDP-S6500, BDP-S5500, BDP-S4500, BDP-S3500, BDP-S7200, BDP-S6200, BDP-S5200, BDP-S4200, BDP-S3200, BDP-BX620, BDP-BX520, BDP-BX320, BDP-S5100, BDP-S4100, BDP-S3100, BDP-BX510, BDP-BX310, BDP-A6000, BDP-S790, BDP-S590, BDP-S490, BDP-S390, BDP-BX59, BDP-BX39, BDP-S780, BDP-S580, BDP-S480, BDP-S380, BDP-BX58, BDP-BX38, BDP-S1700ES, BDP-S770, BDP-S570, BDP-S470, BDP-S370, BDP-BX57, BDP-BX37

Blu-ray Disc™/DVD Home Theatre System
BDV-N9200WL, BDV-N9200W, BDV-NF7220, BDV-N7200WL, BDV-N7200W, BDV-N5200W, BDV-E3200, BDV-N9900SH, BDV-N9150WL, BDV-N9150W, BDV-N9100WL, BDV-N9100W , BDV-N8100WL, BDV-N8100W , BDV-N7100WL, BDV-N7100W, BDV-E6100 , BDV-E5100, BDV-E4100, BDV-E3100, BDV-E2100, BDV-EF1100, BDV-N995W, BDV-N990W, BDV-N890W, BDV-N790W, BDV-N590, BDV-E690, BDV-E490, BDV-E390, BDV-E385, BDV-E290, BDV-E190, BDV-NF720, BDV-NF620, BDV-EF420, BDV-EF220, BDV-T79, BDV-T39, BDV-E985W, BDV-E980W, BDV-E980, BDV-E880, BDV-E780W, BDV-E580, BDV-E380, BDV-L800M, BDV-L800, BDV-L600, BDV-T58, BDV-IZ1000W, BDV-HZ970W, BDV-E970W, BDV-E870, BDV-E770W, BDV-E670W, BDV-E570, BDV-E470, BDV-E370, BDV-F700, BDV-F500, BDV-F7, BDV-T57

Streaming Player / Network Media Player
NSZ-GS8, NSZ-GU1, NSZ-GX70, NSZ-GS7, SMP-N200, SMP-N100

Sony Internet TV
NSX-46GT1, NSX-40GT1, NSX-32GT1, NSX-24GT1, NSZ-GT1

AV Receiver
STR-DN1070, STR-DN1060, STR-DN860, STR-DN1050, STR-DN850, STR-DN1040, STR-DN840, STR-DA1800ES, STR-DN1030, STR-DN1020

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 15 mars 2018, 22:04
par Sh0n
Hello :)

As-tu testé de contrôler dans un premier temps ton HC via un simple script en attendant un plugin dédié ?

Je te mets ci-dessous mon script, dérivé de celui dispo sur le market du plugin script.
La seule chose que tu as à adapter c'est les infos SonyBraviaIP et SonyBraviaMAC en mettant celles correspondant à ton HC.

Code : Tout sélectionner

#!/bin/bash

SonyBraviaPreSharedKey="sony"
SonyBraviaIP="IP DE TON HOME CINEMA"
SonyBraviaMAC="ADRESSE MAC DE TON HOME CINEMA"
ExtraNum="ko"

set -e

cd $(dirname $0)

if [ "$1" = "" ]; then
  echo "Usage: $0 <COMMAND>"
  exit 1
fi

if [ "$1" = "PowerOn" ]; then
  wakeonlan $SonyBraviaMAC >/dev/null
  echo "PowerOn: ✓"
  exit 0
fi

if [ "${1:0:3}" = "Num" ]; then
	if (( "${1:3:2}" > "9" )); then
        ExtraNum="ok"
        Num1="Num${1:3:1}"
        Num2="Num${1:4:1}"
    fi
fi

declare -A commandmap
commandmap[PowerOff]="AAAAAQAAAAEAAAAvAw=="
commandmap[PowerOn]="AAAAAQAAAAEAAAAuAw=="
commandmap[VolumeUp]="AAAAAQAAAAEAAAASAw=="
commandmap[VolumeDown]="AAAAAQAAAAEAAAATAw=="
commandmap[Mute]="AAAAAQAAAAEAAAAUAw=="
commandmap[Input]="AAAAAQAAAAEAAAAlAw=="
commandmap[GGuide]="AAAAAQAAAAEAAAAOAw=="
commandmap[EPG]="AAAAAgAAAKQAAABbAw=="
commandmap[Favorites]="AAAAAgAAAHcAAAB2Aw=="
commandmap[Display]="AAAAAQAAAAEAAAA6Aw=="
commandmap[Home]="AAAAAQAAAAEAAABgAw=="
commandmap[Options]="AAAAAgAAAJcAAAA2Aw=="
commandmap[Return]="AAAAAgAAAJcAAAAjAw=="
commandmap[Up]="AAAAAQAAAAEAAAB0Aw=="
commandmap[Down]="AAAAAQAAAAEAAAB1Aw=="
commandmap[Right]="AAAAAQAAAAEAAAAzAw=="
commandmap[Left]="AAAAAQAAAAEAAAA0Aw=="
commandmap[Confirm]="AAAAAQAAAAEAAABlAw=="
commandmap[Red]="AAAAAgAAAJcAAAAlAw=="
commandmap[Green]="AAAAAgAAAJcAAAAmAw=="
commandmap[Yellow]="AAAAAgAAAJcAAAAnAw=="
commandmap[Blue]="AAAAAgAAAJcAAAAkAw=="
commandmap[Num1]="AAAAAQAAAAEAAAAAAw=="
commandmap[Num2]="AAAAAQAAAAEAAAABAw=="
commandmap[Num3]="AAAAAQAAAAEAAAACAw=="
commandmap[Num4]="AAAAAQAAAAEAAAADAw=="
commandmap[Num5]="AAAAAQAAAAEAAAAEAw=="
commandmap[Num6]="AAAAAQAAAAEAAAAFAw=="
commandmap[Num7]="AAAAAQAAAAEAAAAGAw=="
commandmap[Num8]="AAAAAQAAAAEAAAAHAw=="
commandmap[Num9]="AAAAAQAAAAEAAAAIAw=="
commandmap[Num0]="AAAAAQAAAAEAAAAJAw=="
#commandmap[Num11]="AAAAAQAAAAEAAAAKAw=="
#commandmap[Num12]="AAAAAQAAAAEAAAALAw=="

commandmap[ChannelUp]="AAAAAQAAAAEAAAAQAw=="
commandmap[ChannelDown]="AAAAAQAAAAEAAAARAw=="
commandmap[SubTitle]="AAAAAgAAAJcAAAAoAw=="
commandmap[ClosedCaption]="AAAAAgAAAKQAAAAQAw=="
commandmap[Enter]="AAAAAQAAAAEAAAALAw=="
commandmap[DOT]="AAAAAgAAAJcAAAAdAw=="
commandmap[Analog]="AAAAAgAAAHcAAAANAw=="
commandmap[Teletext]="AAAAAQAAAAEAAAA/Aw=="
commandmap[Exit]="AAAAAQAAAAEAAABjAw=="
commandmap[Analog2]="AAAAAQAAAAEAAAA4Aw=="
commandmap[*AD]="AAAAAgAAABoAAAA7Aw=="
commandmap[Digital]="AAAAAgAAAJcAAAAyAw=="
commandmap[Analog?]="AAAAAgAAAJcAAAAuAw=="
commandmap[BS]="AAAAAgAAAJcAAAAsAw=="
commandmap[CS]="AAAAAgAAAJcAAAArAw=="
commandmap[BSCS]="AAAAAgAAAJcAAAAQAw=="
commandmap[Ddata]="AAAAAgAAAJcAAAAVAw=="
commandmap[PicOff]="AAAAAQAAAAEAAAA+Aw=="
commandmap[Tv_Radio]="AAAAAgAAABoAAABXAw=="
commandmap[Theater]="AAAAAgAAAHcAAABgAw=="
commandmap[SEN]="AAAAAgAAABoAAAB9Aw=="
commandmap[InternetWidgets]="AAAAAgAAABoAAAB6Aw=="
commandmap[InternetVideo]="AAAAAgAAABoAAAB5Aw=="
commandmap[Netflix]="AAAAAgAAABoAAAB8Aw=="
commandmap[SceneSelect]="AAAAAgAAABoAAAB4Aw=="
commandmap[Mode3D]="AAAAAgAAAHcAAABNAw=="
commandmap[iManual]="AAAAAgAAABoAAAB7Aw=="
commandmap[Audio]="AAAAAQAAAAEAAAAXAw=="
commandmap[Wide]="AAAAAgAAAKQAAAA9Aw=="
commandmap[Jump]="AAAAAQAAAAEAAAA7Aw=="
commandmap[PAP]="AAAAAgAAAKQAAAB3Aw=="
commandmap[MyEPG]="AAAAAgAAAHcAAABrAw=="
commandmap[ProgramDescription]="AAAAAgAAAJcAAAAWAw=="
commandmap[WriteChapter]="AAAAAgAAAHcAAABsAw=="
commandmap[TrackID]="AAAAAgAAABoAAAB+Aw=="
commandmap[TenKey]="AAAAAgAAAJcAAAAMAw=="
commandmap[AppliCast]="AAAAAgAAABoAAABvAw=="
commandmap[acTVila]="AAAAAgAAABoAAAByAw=="
commandmap[DeleteVideo]="AAAAAgAAAHcAAAAfAw=="
commandmap[PhotoFrame]="AAAAAgAAABoAAABVAw=="
commandmap[TvPause]="AAAAAgAAABoAAABnAw=="
commandmap[KeyPad]="AAAAAgAAABoAAAB1Aw=="
commandmap[Media]="AAAAAgAAAJcAAAA4Aw=="
commandmap[SyncMenu]="AAAAAgAAABoAAABYAw=="
commandmap[Forward]="AAAAAgAAAJcAAAAcAw=="
commandmap[Play]="AAAAAgAAAJcAAAAaAw=="
commandmap[Rewind]="AAAAAgAAAJcAAAAbAw=="
commandmap[Prev]="AAAAAgAAAJcAAAA8Aw=="
commandmap[Stop]="AAAAAgAAAJcAAAAYAw=="
commandmap[Next]="AAAAAgAAAJcAAAA9Aw=="
commandmap[Rec]="AAAAAgAAAJcAAAAgAw=="
commandmap[Pause]="AAAAAgAAAJcAAAAZAw=="
commandmap[Eject]="AAAAAgAAAJcAAABIAw=="
commandmap[FlashPlus]="AAAAAgAAAJcAAAB4Aw=="
commandmap[FlashMinus]="AAAAAgAAAJcAAAB5Aw=="
commandmap[TopMenu]="AAAAAgAAABoAAABgAw=="
commandmap[PopUpMenu]="AAAAAgAAABoAAABhAw=="
commandmap[RakurakuStart]="AAAAAgAAAHcAAABqAw=="
commandmap[OneTouchTimeRec]="AAAAAgAAABoAAABkAw=="
commandmap[OneTouchView]="AAAAAgAAABoAAABlAw=="
commandmap[OneTouchRec]="AAAAAgAAABoAAABiAw=="
commandmap[OneTouchStop]="AAAAAgAAABoAAABjAw=="
commandmap[DUX]="AAAAAgAAABoAAABzAw=="
commandmap[FootballMode]="AAAAAgAAABoAAAB2Aw=="
commandmap[Social]="AAAAAgAAABoAAAB0Aw=="
commandmap[HDMI1]="AAAAAgAAABoAAABaAw=="
commandmap[HDMI2]="AAAAAgAAABoAAABbAw=="

IRCC=${commandmap[$1]}

if [ "$IRCC" = "" ]; then
	if [ "$ExtraNum" = "ok" ]; then
    	IRCC1=${commandmap[$Num1]}
    	IRCC2=${commandmap[$Num2]}
        
		code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/sony/IRCC -H "X-Auth-PSK:$SonyBraviaPreSharedKey" -d "<?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>"$IRCC1"</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)
		sleep .2
        code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/sony/IRCC -H "X-Auth-PSK:$SonyBraviaPreSharedKey" -d "<?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>"$IRCC2"</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)
		
        exit 0
	else
       	echo "Unknown command $1"
    	exit 1
    fi
    else
    code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/sony/IRCC -H "X-Auth-PSK:$SonyBraviaPreSharedKey" -d "<?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>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)
	exit 0
fi
Pour l'utiliser ensuite dans le plugin script, la syntaxe est la suivante :

Image

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 17 mars 2018, 16:56
par BLRPERES
Bonjour

ce fil m'intéresse
moi meme propriétaire d'une télé SONY KDL46 HX750 je ne peux pas contrôler ma tv via l'autre plugin.

J'attends beaucoup d'une possible solution complémentaire

de ce que j'ai compris il faudrait utiliser quelque chose de compatible avec la fonction renderer de Sony.
pour en savoir plus suivre le lien suivant:
http://sony-eur-eu-fr-web--eur.custhelp ... D%C2%A0%3F

Il existe une application sur nos smartphone qui utilise cette fonction et qui s'appelle "TV sideView" http://info.tvsideview.sony.net/fr/home ... tml#stream

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 01 mai 2018, 00:31
par DavZero
Salut,

d'après ce que je vois, le fonctionnement de l'API est basé sur l'upnp, l'un de vous a t il essayer avec le plugin upnp ?
D'après ce que je vois de l'API, il doit y avoir un service upnp IRCC qui permet de commander la TV. Il faut voir les commandes qu'il expose et jouer avec via le plugin upnp. Si ca fonctionne mais que ça demande trop d'opération manuel, je pourrais integrer des choses spécifiques au plugin pour gérer ces périphériques.

A+

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 01 mai 2018, 11:31
par BLRPERES
DavZero a écrit :Salut,

d'après ce que je vois, le fonctionnement de l'API est basé sur l'upnp, l'un de vous a t il essayer avec le plugin upnp ?
D'après ce que je vois de l'API, il doit y avoir un service upnp IRCC qui permet de commander la TV. Il faut voir les commandes qu'il expose et jouer avec via le plugin upnp. Si ca fonctionne mais que ça demande trop d'opération manuel, je pourrais integrer des choses spécifiques au plugin pour gérer ces périphériques.

A+
Bonne idée
Je tenterai ma chance la semaine prochaine


Envoyé de mon iPhone en utilisant Tapatalk

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 01 mai 2018, 11:31
par BLRPERES
DavZero a écrit :Salut,

d'après ce que je vois, le fonctionnement de l'API est basé sur l'upnp, l'un de vous a t il essayer avec le plugin upnp ?
D'après ce que je vois de l'API, il doit y avoir un service upnp IRCC qui permet de commander la TV. Il faut voir les commandes qu'il expose et jouer avec via le plugin upnp. Si ca fonctionne mais que ça demande trop d'opération manuel, je pourrais integrer des choses spécifiques au plugin pour gérer ces périphériques.

A+
Bonne idée
Je tenterai ma chance la semaine prochaine


Envoyé de mon iPhone en utilisant Tapatalk

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 05 juin 2018, 16:00
par BLRPERES
Sh0n a écrit :
15 mars 2018, 22:04
Hello :)

As-tu testé de contrôler dans un premier temps ton HC via un simple script en attendant un plugin dédié ?

Je te mets ci-dessous mon script, dérivé de celui dispo sur le market du plugin script.
La seule chose que tu as à adapter c'est les infos SonyBraviaIP et SonyBraviaMAC en mettant celles correspondant à ton HC.

Code : Tout sélectionner

#!/bin/bash

SonyBraviaPreSharedKey="sony"
SonyBraviaIP="IP DE TON HOME CINEMA"
SonyBraviaMAC="ADRESSE MAC DE TON HOME CINEMA"
ExtraNum="ko"

set -e

cd $(dirname $0)

if [ "$1" = "" ]; then
  echo "Usage: $0 <COMMAND>"
  exit 1
fi

if [ "$1" = "PowerOn" ]; then
  wakeonlan $SonyBraviaMAC >/dev/null
  echo "PowerOn: ✓"
  exit 0
fi

if [ "${1:0:3}" = "Num" ]; then
	if (( "${1:3:2}" > "9" )); then
        ExtraNum="ok"
        Num1="Num${1:3:1}"
        Num2="Num${1:4:1}"
    fi
fi

declare -A commandmap
commandmap[PowerOff]="AAAAAQAAAAEAAAAvAw=="
commandmap[PowerOn]="AAAAAQAAAAEAAAAuAw=="
commandmap[VolumeUp]="AAAAAQAAAAEAAAASAw=="
commandmap[VolumeDown]="AAAAAQAAAAEAAAATAw=="
commandmap[Mute]="AAAAAQAAAAEAAAAUAw=="
commandmap[Input]="AAAAAQAAAAEAAAAlAw=="
commandmap[GGuide]="AAAAAQAAAAEAAAAOAw=="
commandmap[EPG]="AAAAAgAAAKQAAABbAw=="
commandmap[Favorites]="AAAAAgAAAHcAAAB2Aw=="
commandmap[Display]="AAAAAQAAAAEAAAA6Aw=="
commandmap[Home]="AAAAAQAAAAEAAABgAw=="
commandmap[Options]="AAAAAgAAAJcAAAA2Aw=="
commandmap[Return]="AAAAAgAAAJcAAAAjAw=="
commandmap[Up]="AAAAAQAAAAEAAAB0Aw=="
commandmap[Down]="AAAAAQAAAAEAAAB1Aw=="
commandmap[Right]="AAAAAQAAAAEAAAAzAw=="
commandmap[Left]="AAAAAQAAAAEAAAA0Aw=="
commandmap[Confirm]="AAAAAQAAAAEAAABlAw=="
commandmap[Red]="AAAAAgAAAJcAAAAlAw=="
commandmap[Green]="AAAAAgAAAJcAAAAmAw=="
commandmap[Yellow]="AAAAAgAAAJcAAAAnAw=="
commandmap[Blue]="AAAAAgAAAJcAAAAkAw=="
commandmap[Num1]="AAAAAQAAAAEAAAAAAw=="
commandmap[Num2]="AAAAAQAAAAEAAAABAw=="
commandmap[Num3]="AAAAAQAAAAEAAAACAw=="
commandmap[Num4]="AAAAAQAAAAEAAAADAw=="
commandmap[Num5]="AAAAAQAAAAEAAAAEAw=="
commandmap[Num6]="AAAAAQAAAAEAAAAFAw=="
commandmap[Num7]="AAAAAQAAAAEAAAAGAw=="
commandmap[Num8]="AAAAAQAAAAEAAAAHAw=="
commandmap[Num9]="AAAAAQAAAAEAAAAIAw=="
commandmap[Num0]="AAAAAQAAAAEAAAAJAw=="
#commandmap[Num11]="AAAAAQAAAAEAAAAKAw=="
#commandmap[Num12]="AAAAAQAAAAEAAAALAw=="

commandmap[ChannelUp]="AAAAAQAAAAEAAAAQAw=="
commandmap[ChannelDown]="AAAAAQAAAAEAAAARAw=="
commandmap[SubTitle]="AAAAAgAAAJcAAAAoAw=="
commandmap[ClosedCaption]="AAAAAgAAAKQAAAAQAw=="
commandmap[Enter]="AAAAAQAAAAEAAAALAw=="
commandmap[DOT]="AAAAAgAAAJcAAAAdAw=="
commandmap[Analog]="AAAAAgAAAHcAAAANAw=="
commandmap[Teletext]="AAAAAQAAAAEAAAA/Aw=="
commandmap[Exit]="AAAAAQAAAAEAAABjAw=="
commandmap[Analog2]="AAAAAQAAAAEAAAA4Aw=="
commandmap[*AD]="AAAAAgAAABoAAAA7Aw=="
commandmap[Digital]="AAAAAgAAAJcAAAAyAw=="
commandmap[Analog?]="AAAAAgAAAJcAAAAuAw=="
commandmap[BS]="AAAAAgAAAJcAAAAsAw=="
commandmap[CS]="AAAAAgAAAJcAAAArAw=="
commandmap[BSCS]="AAAAAgAAAJcAAAAQAw=="
commandmap[Ddata]="AAAAAgAAAJcAAAAVAw=="
commandmap[PicOff]="AAAAAQAAAAEAAAA+Aw=="
commandmap[Tv_Radio]="AAAAAgAAABoAAABXAw=="
commandmap[Theater]="AAAAAgAAAHcAAABgAw=="
commandmap[SEN]="AAAAAgAAABoAAAB9Aw=="
commandmap[InternetWidgets]="AAAAAgAAABoAAAB6Aw=="
commandmap[InternetVideo]="AAAAAgAAABoAAAB5Aw=="
commandmap[Netflix]="AAAAAgAAABoAAAB8Aw=="
commandmap[SceneSelect]="AAAAAgAAABoAAAB4Aw=="
commandmap[Mode3D]="AAAAAgAAAHcAAABNAw=="
commandmap[iManual]="AAAAAgAAABoAAAB7Aw=="
commandmap[Audio]="AAAAAQAAAAEAAAAXAw=="
commandmap[Wide]="AAAAAgAAAKQAAAA9Aw=="
commandmap[Jump]="AAAAAQAAAAEAAAA7Aw=="
commandmap[PAP]="AAAAAgAAAKQAAAB3Aw=="
commandmap[MyEPG]="AAAAAgAAAHcAAABrAw=="
commandmap[ProgramDescription]="AAAAAgAAAJcAAAAWAw=="
commandmap[WriteChapter]="AAAAAgAAAHcAAABsAw=="
commandmap[TrackID]="AAAAAgAAABoAAAB+Aw=="
commandmap[TenKey]="AAAAAgAAAJcAAAAMAw=="
commandmap[AppliCast]="AAAAAgAAABoAAABvAw=="
commandmap[acTVila]="AAAAAgAAABoAAAByAw=="
commandmap[DeleteVideo]="AAAAAgAAAHcAAAAfAw=="
commandmap[PhotoFrame]="AAAAAgAAABoAAABVAw=="
commandmap[TvPause]="AAAAAgAAABoAAABnAw=="
commandmap[KeyPad]="AAAAAgAAABoAAAB1Aw=="
commandmap[Media]="AAAAAgAAAJcAAAA4Aw=="
commandmap[SyncMenu]="AAAAAgAAABoAAABYAw=="
commandmap[Forward]="AAAAAgAAAJcAAAAcAw=="
commandmap[Play]="AAAAAgAAAJcAAAAaAw=="
commandmap[Rewind]="AAAAAgAAAJcAAAAbAw=="
commandmap[Prev]="AAAAAgAAAJcAAAA8Aw=="
commandmap[Stop]="AAAAAgAAAJcAAAAYAw=="
commandmap[Next]="AAAAAgAAAJcAAAA9Aw=="
commandmap[Rec]="AAAAAgAAAJcAAAAgAw=="
commandmap[Pause]="AAAAAgAAAJcAAAAZAw=="
commandmap[Eject]="AAAAAgAAAJcAAABIAw=="
commandmap[FlashPlus]="AAAAAgAAAJcAAAB4Aw=="
commandmap[FlashMinus]="AAAAAgAAAJcAAAB5Aw=="
commandmap[TopMenu]="AAAAAgAAABoAAABgAw=="
commandmap[PopUpMenu]="AAAAAgAAABoAAABhAw=="
commandmap[RakurakuStart]="AAAAAgAAAHcAAABqAw=="
commandmap[OneTouchTimeRec]="AAAAAgAAABoAAABkAw=="
commandmap[OneTouchView]="AAAAAgAAABoAAABlAw=="
commandmap[OneTouchRec]="AAAAAgAAABoAAABiAw=="
commandmap[OneTouchStop]="AAAAAgAAABoAAABjAw=="
commandmap[DUX]="AAAAAgAAABoAAABzAw=="
commandmap[FootballMode]="AAAAAgAAABoAAAB2Aw=="
commandmap[Social]="AAAAAgAAABoAAAB0Aw=="
commandmap[HDMI1]="AAAAAgAAABoAAABaAw=="
commandmap[HDMI2]="AAAAAgAAABoAAABbAw=="

IRCC=${commandmap[$1]}

if [ "$IRCC" = "" ]; then
	if [ "$ExtraNum" = "ok" ]; then
    	IRCC1=${commandmap[$Num1]}
    	IRCC2=${commandmap[$Num2]}
        
		code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/sony/IRCC -H "X-Auth-PSK:$SonyBraviaPreSharedKey" -d "<?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>"$IRCC1"</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)
		sleep .2
        code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/sony/IRCC -H "X-Auth-PSK:$SonyBraviaPreSharedKey" -d "<?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>"$IRCC2"</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)
		
        exit 0
	else
       	echo "Unknown command $1"
    	exit 1
    fi
    else
    code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/sony/IRCC -H "X-Auth-PSK:$SonyBraviaPreSharedKey" -d "<?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>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)
	exit 0
fi
Pour l'utiliser ensuite dans le plugin script, la syntaxe est la suivante :

Image
comment ça marche exactement un script? est-ce qu'il faut découper le code en plusieurs commandes?
dans la deuxième partie de ton message tu fais référence à une syntaxe mais l'image ne s'affiche pas.

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 08 juin 2018, 18:42
par Sh0n
Hello,

Non le script doit être le même pour toutes les commandes.
La syntaxe pour l'utiliser est la suivante :
script_bravia.png
script_bravia.png (47.23 Kio) Consulté 4538 fois

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 17 juil. 2018, 09:43
par Saint-Jey
Sh0n a écrit :
08 juin 2018, 18:42
Hello,

Non le script doit être le même pour toutes les commandes.
La syntaxe pour l'utiliser est la suivante :
script_bravia.png
Merci pour ton retour !
Comment configures-tu le script ? L'image que tu as posté a visiblement disparu.

Encore merci pour ton aide

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 17 juil. 2018, 10:08
par BLRPERES
Sh0n a écrit :Hello,

Non le script doit être le même pour toutes les commandes.
La syntaxe pour l'utiliser est la suivante :
script_bravia.png
Ok
Je pense avoir compris pour la deuxième partie

Mais par contre c’est pas clair pour moi pour le première partie
Que dois-je faire avec le gros script ?
Créer un nouvel équipement et même une seule commande avec tout le texte adapté dedans ?!


Envoyé de mon iPhone en utilisant Tapatalk

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 08 août 2018, 17:10
par Saint-Jey
BLRPERES a écrit :
17 juil. 2018, 10:08
Sh0n a écrit :Hello,

Non le script doit être le même pour toutes les commandes.
La syntaxe pour l'utiliser est la suivante :
script_bravia.png
Ok
Je pense avoir compris pour la deuxième partie

Mais par contre c’est pas clair pour moi pour le première partie
Que dois-je faire avec le gros script ?
Créer un nouvel équipement et même une seule commande avec tout le texte adapté dedans ?!


Envoyé de mon iPhone en utilisant Tapatalk
Je crois que je viens de comprendre : il faut déposer un fichier remote_tv_sony.sh dans le répertoire qui va bien (plugin/script/core/ressources) et ensuite on appelle ce script depuis l'équipement
Dès que j'ai du temps je vais tester

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 08 août 2018, 23:25
par Saint-Jey
Alors j'ai essayé et voici mes premiers résultats :
- PowerOn, ça fonctionne pas de souci
- PowerOff, j'ai un code erreur : Erreur dans l'exécution du terminal, la valeur retournée est : 7. Détails : Array ( [0] => )
@Sh0n, ce message erreur signifie quoi ? Que le code associé à la commande PowerOff dans le .sh est faux pour mon matériel ?

Même code erreur pour volumeup et volumedown et mute.
En fait, je pense que PowerOn fonctionne parce que il fait un wake on lan.
en regardant dans le .sh, je remarque qu'il demande une variable "PreShared key :
-XPOST http://$SonyBraviaIP/sony/IRCC -H "X-Auth-PSK:$SonyBraviaPreSharedKey" -d "<?xml version=\"1.0\"?>

hors celle-ci n'est entrée nulle part dans le .sh

EDIT : ah si, elle est renseignée à sony... c'est bizarre, je n'ai jamais tapé cette clé sur mon home cinema

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 10 sept. 2018, 13:55
par Saint-Jey
Bon décidément je n'y arrive pas.
Mon home cinema est à connecter en mode renderer. Quand j'essaye de connecter mon smartphone, il y a un mot de passe à 4 chiffres qui s'affiche sur la tv (via le home cinema). Vous avez eu un mot de passe qui s'est affiché lors de l'utilisation de ce script ?

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 04 mars 2019, 23:23
par bd_38
Bonsoir,

Je rencontre le même problème. As tu réussi à trouver une solution ?

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 04 mars 2019, 23:43
par Saint-Jey
Pour le moment non mais j’avoue que j’ai un nouveau boulot et entre ça et ma passion pour l’adtr J’ai plus trop de temps pour ce script Jeedom

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 04 mars 2019, 23:46
par bd_38
Je vais continuer de chercher. Merci

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 15 mars 2019, 16:58
par bd_38
Bonjour,

J'ai mis à jour le script pour prendre en compte les anciens modèle, en particulier, mon home Cinéma

#!/bin/bash

SonyBraviaPreSharedKey="sony"
SonyBraviaIP="XXX"
SonyBraviaMAC="XXX"
TVMAC="XXX"
ExtraNum="ko"

set -e

cd $(dirname $0)

if [ "$1" = "" ]; then
echo "Usage: $0 <COMMAND>"
exit 1
fi

if [ "$1" = "PowerOn" ]; then
wakeonlan $SonyBraviaMAC >/dev/null
echo "PowerOn: ✓"
exit 0
fi

if [ "$1" = "TVOn" ]; then
wakeonlan $TVMAC >/dev/null
echo "PowerOn: ✓"
exit 0
fi

if [ "$1" = "Auth" ]; then

CT="Content-Type:application/json"

TEST="curl http://192.168.1.107:50002/register?nam ... 9b3320d076 "
echo $TEST

RESPONSE=`$TEST`
echo $RESPONSE
#code=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X GET http://192.168.1.107:50002/register?nam ... 9b3320d076)
#HTTP_BODY=$(echo $code | sed -e 's/HTTPSTATUS\:.*//g')
#echo "Authentification $HTTP_BODY"
#echo "Retour $code"
exit 0
fi

if [ "$1" = "ReAuth" ]; then

CT="Content-Type:application/json"

TEST="curl http://192.168.1.107:50002/register?nam ... 9b3320d076 "
echo $TEST

RESPONSE=`$TEST`
echo $RESPONSE
#code=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X GET http://192.168.1.107:50002/register?nam ... 9b3320d076)
#HTTP_BODY=$(echo $code | sed -e 's/HTTPSTATUS\:.*//g')
#echo "Authentification $HTTP_BODY"
#echo "Retour $code"
exit 0
fi

if [ "${1:0:3}" = "Num" ]; then
if (( "${1:3:2}" > "9" )); then
ExtraNum="ok"
Num1="Num${1:3:1}"
Num2="Num${1:4:1}"
fi
fi

declare -A commandmap
commandmap[Confirm]="AAAAAwAAAhAAAAB8Aw=="
commandmap[Up]="AAAAAwAAAhAAAAB4Aw=="
commandmap[Down]="AAAAAwAAAhAAAAB5Aw=="
commandmap[Right]="AAAAAwAAAhAAAAB7Aw=="
commandmap[Left]="AAAAAwAAAhAAAAB6Aw=="
commandmap[Home]="AAAAAgAAANAAAAAHAw=="
commandmap[Options]="AAAAAwAAAhAAAABzAw=="
commandmap[Return]="AAAAAwAAAhAAAAB9Aw=="
commandmap[Num1]="AAAAAwAAAhAAAAAAAw=="
commandmap[Num2]="AAAAAwAAAhAAAAABAw=="
commandmap[Num3]="AAAAAwAAAhAAAAACAw=="
commandmap[Num4]="AAAAAwAAAhAAAAADAw=="
commandmap[Num5]="AAAAAwAAAhAAAAAEAw=="
commandmap[Num6]="AAAAAwAAAhAAAAAFAw=="
commandmap[Num7]="AAAAAwAAAhAAAAAGAw=="
commandmap[Num8]="AAAAAwAAAhAAAAAHAw=="
commandmap[Num9]="AAAAAwAAAhAAAAAIAw=="
commandmap[Num0]="AAAAAwAAAhAAAAAJAw=="
commandmap[Power]="AAAAAgAAAFAAAAAVAw=="
commandmap[Display]="AAAAAwAAAhAAAAAYAw=="
commandmap[VolumeUp]="AAAAAgAAAFAAAAASAw=="
commandmap[VolumeDown]="AAAAAgAAAFAAAAATAw=="
commandmap[Mute]="AAAAAgAAAFAAAAAUAw=="
commandmap[Audio]="AAAAAwAAAhAAAAASAw=="
commandmap[SubTitle]="AAAAAwAAAhAAAAARAw=="
commandmap[Angle]="AAAAAwAAAhAAAAATAw=="
commandmap[Favorites]="AAAAAwAABhAAAABLAw=="
commandmap[Yellow]="AAAAAwAABhAAAAAHAw=="
commandmap[Blue]="AAAAAwAABhAAAAAEAw=="
commandmap[Red]="AAAAAwAABhAAAAAFAw=="
commandmap[Green]="AAAAAwAABhAAAAAGAw=="
commandmap[Play]="AAAAAgAAANAAAAACAw=="
commandmap[Stop]="AAAAAgAAANAAAAAAAw=="
commandmap[Pause]="AAAAAgAAANAAAAABAw=="
commandmap[Rewind]="AAAAAwAAAhAAAAAzAw=="
commandmap[Forward]="AAAAAwAAAhAAAAA0Aw=="
commandmap[Prev]="AAAAAwAAAhAAAAAwAw=="
commandmap[Next]="AAAAAwAAAhAAAAAxAw=="
commandmap[Replay]="AAAAAwAAAhAAAAAhAw=="
commandmap[Advance]="AAAAAwAAAhAAAAAgAw=="
commandmap[TopMenu]="AAAAAwAAAhAAAAAZAw=="
commandmap[PopUpMenu]="AAAAAwAAAhAAAAAaAw=="
commandmap[Eject]="AAAAAwAAAhAAAAA8Aw=="
commandmap[BDV:SoundOutput]="AAAAAwAABhAAAABFAw=="
commandmap[Dimmer]="AAAAAgAAAFAAAABNAw=="
commandmap[BDV:Sleep]="AAAAAgAAAFAAAABgAw=="
commandmap[BDV:Function]="AAAAAgAAANAAAABpAw=="
commandmap[BDV:SoundMode]="AAAAAgAAANAAAABuAw=="
commandmap[BDV:SoundModeDown]="AAAAAgAAANAAAABeAw=="
commandmap[BDV:SoundModeUp]="AAAAAgAAANAAAABLAw=="
commandmap[Enter]="AAAAAwAAAhAAAAAMAw=="
commandmap[SEN]="AAAAAwAADhAAAABQAw=="
commandmap[Netflix]="AAAAAwAADhAAAABRAw=="
commandmap[Mode3D]="AAAAAwAABhAAAABMAw=="
commandmap[BDV:KeyControl-]="AAAAAgAAANAAAAAXAw=="
commandmap[BDV:KeyControl+]="AAAAAgAAANAAAAAWAw=="
commandmap[BDV:Echo]="AAAAAgAAANAAAAAUAw=="
commandmap[BDV:MicVol+]="AAAAAgAAANAAAAASAw=="
commandmap[BDV:MicVol-]="AAAAAgAAANAAAAATAw=="
commandmap[BDV:Bluetooth]="AAAAAwAABhAAAABxAw=="
commandmap[BDV:MusicEQ]="AAAAAgAAANAAAABJAw=="
commandmap[BDV:SpeakerIllumination]="AAAAAwAABhAAAABgAw=="
commandmap[BDV:FootBall]="AAAAAwAADhAAAAAXAw=="
commandmap[HDMI1]="AAAAAgAAANAAAAAHAw=="
commandmap[HDMI2]="AAAAAgAAABoAAABbAw=="

IRCC=${commandmap[$1]}

if [ "$IRCC" = "" ]; then
if [ "$ExtraNum" = "ok" ]; then
IRCC1=${commandmap[$Num1]}
IRCC2=${commandmap[$Num2]}

code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/upnp/control/IRCC -d "<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>"$IRCC1"</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)
sleep .2
code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/upnp/control/IRCC -d "<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>"$IRCC2"</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)

exit 0
else
echo "Unknown command $1"
exit 1
fi
else
#code="curl http://$SonyBraviaIP:50001/upnp/control/IRCC -d \"<?xml version='1.0'?><s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' s:encodingStyle='http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u='urn:schemas-sony-com:service:IRCC:1'><IRCCCode>$IRCC</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>"
#-H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: \"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\"' -o /dev/null"
strcommande="<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>$IRCC</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>"
strSoap="soapaction: \"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\""
#strCode="curl http://$SonyBraviaIP:50001/upnp/control/IRCC -d $strcommande -H 'Content-Type: text/xml' -H $strSoap"
#-o /dev/null"
#echo $strCode -d $strcommande
code=$(curl -XPOST http://$SonyBraviaIP:50001/upnp/control/IRCC -H "Content-Type: text/xml" -H "soapaction: \"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\"" -d "<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>$IRCC</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>")
#-d $strcommande
echo "Commande " $IRCC
echo "ligne " $code
#RESPONSE=`$code`
#echo "Réponse " $RESPONSE
exit 0
fi


Il faut mettre le matériel en mode association, puis lancer la commande auth. Le Jeedom sera alors ajouter à la liste des matériels autorisés.
Puis, avant chaque connexion, il faut lancer reauth.

Bon usage

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 15 mars 2019, 17:50
par BLRPERES
bd_38 a écrit :Bonjour,

J'ai mis à jour le script pour prendre en compte les anciens modèle, en particulier, mon home Cinéma

#!/bin/bash

SonyBraviaPreSharedKey="sony"
SonyBraviaIP="XXX"
SonyBraviaMAC="XXX"
TVMAC="XXX"
ExtraNum="ko"

set -e

cd $(dirname $0)

if [ "$1" = "" ]; then
echo "Usage: $0 <COMMAND>"
exit 1
fi

if [ "$1" = "PowerOn" ]; then
wakeonlan $SonyBraviaMAC >/dev/null
echo "PowerOn: ✓"
exit 0
fi

if [ "$1" = "TVOn" ]; then
wakeonlan $TVMAC >/dev/null
echo "PowerOn: ✓"
exit 0
fi

if [ "$1" = "Auth" ]; then

CT="Content-Type:application/json"

TEST="curl http://192.168.1.107:50002/register?nam ... 9b3320d076 "
echo $TEST

RESPONSE=`$TEST`
echo $RESPONSE
#code=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X GET http://192.168.1.107:50002/register?nam ... 9b3320d076)
#HTTP_BODY=$(echo $code | sed -e 's/HTTPSTATUS\:.*//g')
#echo "Authentification $HTTP_BODY"
#echo "Retour $code"
exit 0
fi

if [ "$1" = "ReAuth" ]; then

CT="Content-Type:application/json"

TEST="curl http://192.168.1.107:50002/register?nam ... 9b3320d076 "
echo $TEST

RESPONSE=`$TEST`
echo $RESPONSE
#code=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X GET http://192.168.1.107:50002/register?nam ... 9b3320d076)
#HTTP_BODY=$(echo $code | sed -e 's/HTTPSTATUS\:.*//g')
#echo "Authentification $HTTP_BODY"
#echo "Retour $code"
exit 0
fi

if [ "${1:0:3}" = "Num" ]; then
if (( "${1:3:2}" > "9" )); then
ExtraNum="ok"
Num1="Num${1:3:1}"
Num2="Num${1:4:1}"
fi
fi

declare -A commandmap
commandmap[Confirm]="AAAAAwAAAhAAAAB8Aw=="
commandmap[Up]="AAAAAwAAAhAAAAB4Aw=="
commandmap[Down]="AAAAAwAAAhAAAAB5Aw=="
commandmap[Right]="AAAAAwAAAhAAAAB7Aw=="
commandmap[Left]="AAAAAwAAAhAAAAB6Aw=="
commandmap[Home]="AAAAAgAAANAAAAAHAw=="
commandmap[Options]="AAAAAwAAAhAAAABzAw=="
commandmap[Return]="AAAAAwAAAhAAAAB9Aw=="
commandmap[Num1]="AAAAAwAAAhAAAAAAAw=="
commandmap[Num2]="AAAAAwAAAhAAAAABAw=="
commandmap[Num3]="AAAAAwAAAhAAAAACAw=="
commandmap[Num4]="AAAAAwAAAhAAAAADAw=="
commandmap[Num5]="AAAAAwAAAhAAAAAEAw=="
commandmap[Num6]="AAAAAwAAAhAAAAAFAw=="
commandmap[Num7]="AAAAAwAAAhAAAAAGAw=="
commandmap[Num8]="AAAAAwAAAhAAAAAHAw=="
commandmap[Num9]="AAAAAwAAAhAAAAAIAw=="
commandmap[Num0]="AAAAAwAAAhAAAAAJAw=="
commandmap[Power]="AAAAAgAAAFAAAAAVAw=="
commandmap[Display]="AAAAAwAAAhAAAAAYAw=="
commandmap[VolumeUp]="AAAAAgAAAFAAAAASAw=="
commandmap[VolumeDown]="AAAAAgAAAFAAAAATAw=="
commandmap[Mute]="AAAAAgAAAFAAAAAUAw=="
commandmap[Audio]="AAAAAwAAAhAAAAASAw=="
commandmap[SubTitle]="AAAAAwAAAhAAAAARAw=="
commandmap[Angle]="AAAAAwAAAhAAAAATAw=="
commandmap[Favorites]="AAAAAwAABhAAAABLAw=="
commandmap[Yellow]="AAAAAwAABhAAAAAHAw=="
commandmap[Blue]="AAAAAwAABhAAAAAEAw=="
commandmap[Red]="AAAAAwAABhAAAAAFAw=="
commandmap[Green]="AAAAAwAABhAAAAAGAw=="
commandmap[Play]="AAAAAgAAANAAAAACAw=="
commandmap[Stop]="AAAAAgAAANAAAAAAAw=="
commandmap[Pause]="AAAAAgAAANAAAAABAw=="
commandmap[Rewind]="AAAAAwAAAhAAAAAzAw=="
commandmap[Forward]="AAAAAwAAAhAAAAA0Aw=="
commandmap[Prev]="AAAAAwAAAhAAAAAwAw=="
commandmap[Next]="AAAAAwAAAhAAAAAxAw=="
commandmap[Replay]="AAAAAwAAAhAAAAAhAw=="
commandmap[Advance]="AAAAAwAAAhAAAAAgAw=="
commandmap[TopMenu]="AAAAAwAAAhAAAAAZAw=="
commandmap[PopUpMenu]="AAAAAwAAAhAAAAAaAw=="
commandmap[Eject]="AAAAAwAAAhAAAAA8Aw=="
commandmap[BDV:SoundOutput]="AAAAAwAABhAAAABFAw=="
commandmap[Dimmer]="AAAAAgAAAFAAAABNAw=="
commandmap[BDV:Sleep]="AAAAAgAAAFAAAABgAw=="
commandmap[BDV:Function]="AAAAAgAAANAAAABpAw=="
commandmap[BDV:SoundMode]="AAAAAgAAANAAAABuAw=="
commandmap[BDV:SoundModeDown]="AAAAAgAAANAAAABeAw=="
commandmap[BDV:SoundModeUp]="AAAAAgAAANAAAABLAw=="
commandmap[Enter]="AAAAAwAAAhAAAAAMAw=="
commandmap[SEN]="AAAAAwAADhAAAABQAw=="
commandmap[Netflix]="AAAAAwAADhAAAABRAw=="
commandmap[Mode3D]="AAAAAwAABhAAAABMAw=="
commandmap[BDV:KeyControl-]="AAAAAgAAANAAAAAXAw=="
commandmap[BDV:KeyControl+]="AAAAAgAAANAAAAAWAw=="
commandmap[BDV:Echo]="AAAAAgAAANAAAAAUAw=="
commandmap[BDV:MicVol+]="AAAAAgAAANAAAAASAw=="
commandmap[BDV:MicVol-]="AAAAAgAAANAAAAATAw=="
commandmap[BDV:Bluetooth]="AAAAAwAABhAAAABxAw=="
commandmap[BDV:MusicEQ]="AAAAAgAAANAAAABJAw=="
commandmap[BDV:SpeakerIllumination]="AAAAAwAABhAAAABgAw=="
commandmap[BDV:FootBall]="AAAAAwAADhAAAAAXAw=="
commandmap[HDMI1]="AAAAAgAAANAAAAAHAw=="
commandmap[HDMI2]="AAAAAgAAABoAAABbAw=="

IRCC=${commandmap[$1]}

if [ "$IRCC" = "" ]; then
if [ "$ExtraNum" = "ok" ]; then
IRCC1=${commandmap[$Num1]}
IRCC2=${commandmap[$Num2]}

code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/upnp/control/IRCC -d "<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>"$IRCC1"</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)
sleep .2
code=$(curl -sw "%{http_code}" --silent -XPOST http://$SonyBraviaIP/upnp/control/IRCC -d "<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>"$IRCC2"</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>" -H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: "urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"' -o /dev/null)

exit 0
else
echo "Unknown command $1"
exit 1
fi
else
#code="curl http://$SonyBraviaIP:50001/upnp/control/IRCC -d \"<?xml version='1.0'?><s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' s:encodingStyle='http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u='urn:schemas-sony-com:service:IRCC:1'><IRCCCode>$IRCC</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>"
#-H 'Content-Type: text/xml; charset=UTF-8' -H 'SOAPACTION: \"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\"' -o /dev/null"
strcommande="<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>$IRCC</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>"
strSoap="soapaction: \"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\""
#strCode="curl http://$SonyBraviaIP:50001/upnp/control/IRCC -d $strcommande -H 'Content-Type: text/xml' -H $strSoap"
#-o /dev/null"
#echo $strCode -d $strcommande
code=$(curl -XPOST http://$SonyBraviaIP:50001/upnp/control/IRCC -H "Content-Type: text/xml" -H "soapaction: \"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\"" -d "<?xml version=\"1.0\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encodin ... X_SendIRCC xmlns:u=\"urn:schemas-sony-com:service:IRCC:1\"><IRCCCode>$IRCC</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>")
#-d $strcommande
echo "Commande " $IRCC
echo "ligne " $code
#RESPONSE=`$code`
#echo "Réponse " $RESPONSE
exit 0
fi


Il faut mettre le matériel en mode association, puis lancer la commande auth. Le Jeedom sera alors ajouter à la liste des matériels autorisés.
Puis, avant chaque connexion, il faut lancer reauth.

Bon usage
Miam
Je vais tester



Envoyé de mon iPhone en utilisant Tapatalk

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 15 mars 2019, 17:55
par Saint-Jey
Moi aussi merci dans tous les cas pour ton travail

Re: Plug-in pour commander tous les appareils Sony connectés

Publié : 28 mai 2019, 10:08
par BLRPERES
bonjour a tous

j'avance à petit pas mais j'avance

après avoir ENFIN compris la notion de base du script j'ai donc créé mon fichier comme suis:

Code : Tout sélectionner

cd /var/www/html/plugins/script/core/ressources

Code : Tout sélectionner

sudo nano remote_tv_sony.sh
ensuite j'ai copié collé le dernier texte
j'ai normalement modifié uniquement IP et mac adresse sans modifier
SonyBraviaPreSharedKey="sony"
TVMAC="XXX"
ExtraNum="ko"

ensuite j'ai créer une commande "PowerOn" puis "PowerOff"

mais quand je clique dessus j'ai un message d'erreur:
Erreur dans l'exécution du terminal, la valeur retournée est : 126. Détails : sh: 1: /var/www/html/plugins/script/core/ressources/remote_tv_sony.sh: Permission denied
du coup je me concentre sur la partie authentification?
et notamment le message
Il faut mettre le matériel en mode association, puis lancer la commande auth. Le Jeedom sera alors ajouter à la liste des matériels autorisés.
Puis, avant chaque connexion, il faut lancer reauth.
la j'avoue n'avoir rien compris?

pour info j'ai une tv Sony KDL-46HX750 (renderer donc)