Logic make web request

Hello!

As Sony Android app no longer works on V2. I decided to make a flow which will make a POST request to my TV.

I’ve found a Siri shortcut for it: https://www.reddit.com/r/shortcuts/comments/9oh4zh/control_sony_tv_power_offon_and_other_tv_commands/

This shortcut works pretty well.

I know that homey has a http request app and also in v2 it can make requests via logic make web request. So I made a flow with logic card like this:
Method: POST
URL: http://192.168.8.10/sony/IRCC
Headers: Content-Type:text/xml: charset=UTF-8 SOAPACTION:“urn:schemas-sony-com:service:IRCC:1#X_SendIRCC” X-Auth-PSK:sony
Body: <?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”> AAAAAQAAAAEAAAAVAw==</u:X_SendIRCC></s:Body></s:Envelope>

Everything just copied from shortcut.

But it returns 403, which means no pre-shared-key
I didn’t use a {}.

I think problem with headers.

Could anyone help, how should I list headers there?

Or may be how should use this request in http request app?

Please help)

Thanks to Ricardo Snoek, Jorden Chamid (legacy), Marco Frijmann (legacy).
They just released new Sony Android app. Thanks!

1 Like

Did you manage to get this working. I am using the Logic web request card with PSK. But it wont work. The request gets send but nothing happens.

I did manage to get the Sony Android tv to start a app without using a PSK.

I’m using this Sony android tv app. Before they released the app, I had to try requests, but no luck. So the app helped me a lot. Request in homey are too dumb, they do not support authentication, good xml headers and etc.

Thanx for your reply.

It took some thinking and some try and error, but I got it working. The quotes surrounding the Soapaction need to be taken literally and need to be escaped upon encoding by using the \ symbol. This means the url and the body look like this when using the http request app, POST XML card to toggle the tv on and off:

{"method":"POST","protocol":"http:","host":"192.168.68.60","path":"/sony/ircc","headers":{"SOAPACTION":"\"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC\"","X-Auth-PSK":"1111"}}

<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>AAAAAQAAAAEAAAAVAw==</IRCCCode> </u:X_SendIRCC> </s:Body> </s:Envelope>

Replace the host value to your tv’s IP and change the PSK to your own.

Hope this helps!

1 Like