Turn on/off Telefunken Smart TV B39F545B via Google Home

Post your questions and help other users.

Moderator: Martin

oliver7
Posts: 8
Joined: 17 Jul 2018 16:56
Contact:

Turn on/off Telefunken Smart TV B39F545B via Google Home

Post by oliver7 » 17 Jul 2018 18:58

Hello, y'all!

I've got a Telefunken Smart TV and I want to switch it off with my Google Home. The tv can be switched off/on with:

HTTP POST to http://TVIP:56789/apps/vr/remote
<?xml version="1.0" ?>
<remote>
<key code="1012"/>
</remote>

..so I tried for a week now to create this HTTP POST action in Automagic, but I failed. Pls, can you help me to convert the above code into Automagic's HTTP POST syntax? Tia.
Last edited by oliver7 on 20 Jul 2018 17:39, edited 2 times in total.

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: HTTP POST request

Post by digitalstone » 17 Jul 2018 19:06

I assume you're using the action "HTTP Request".
I've got no TV or Google Home so i can't know for sure...
But have you tried setting the 'Content Type' of the action to "General Text"?

If that's not working, then i suggest placing a condition called "Debug Dialog" after this action.
It will show you all variables and their values that are available that moment.
look especially at the 'response' variable of your "HTTP Request" action.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

oliver7
Posts: 8
Joined: 17 Jul 2018 16:56
Contact:

Re: HTTP POST request

Post by oliver7 » 17 Jul 2018 19:11

yes, it's 'http request', yes, i tried every content-type.

P.S. It should work like this:
IFTTT app recognizes my google home command, IFTTT action = notification which is recognized by Automagic, Automagic action= http post (which turns off/on tv).

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: HTTP POST request

Post by digitalstone » 17 Jul 2018 20:28

What does your Debug Dialog say, can you lay it out here? Screenshot will do.
Is it at all possible with any other type of device right now?

And based on how this should work, there could be a diversity of potential (if not multiple) problems:
- Automagic should have the necessary permissions (e.a to your notifications).
- I don't believe that directly typing that XML script as the POST-message will do. You probably need to use JSON-format or of-the-like.
- Is your TV-Google interface (Chromecast?) performing optimally (also wireless connection itself) ?

You probably searched all week online for answers already, but still: Did you search anything online? ;)
Can't think of anything else at the moment.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: HTTP POST request

Post by Desmanto » 18 Jul 2018 10:46

First of all, Do you get the information from here ? https://thomaskekeisen.de/de/blog/telef ... mart-home/
Since it requires multiple steps, you should try your step by step of the flow from the easiest and things that likely to fail first.

1. Check your connection to the TV. Do you try to ping your TV first? Can your phone reach the TV IP?

2. Once you can ping your TV, example at 192.168.1.100; then you can try the next to HTTP post to it, without any data. Just put debug dialog and observe the response result. You should see an error which stated something like the command is missing or not recognized. This is normal, since we haven't put anything yet. It is just to ensure the webserver at the TV is online.

3. Next, try to post the xml. XML will be recognized as Content type : text/xml. So your http post will be
URL : http://192.168.1.100:56789/apps/vr/remote
Uncheck Verify certificates (https)
Request Method : POST
Content Type : General Text - text/xml
Data

Code: Select all

<?xml version="1.0" ?>
<remote>
<key code="1012"/>
</remote>
Try to execute and check the response at the debug dialog. Does the TV turned off? This is the most crucial part of the whole process. So you need to make sure this is working first before continuing to the other part.

4. After you have successfully turning on/off the TV, we can then create a trigger for it. You use IFTTT to link your google home to the automagic. May I know the command you use? I always found that additional plugin is redundant.

You can always send information from google Home to your phone with the command "Send This to phone". Of course you have to link your phone and google home to the same account. But you need to do that too in IFTTT, should not be a problem.

Simply wake the google, "Hey Google, turn off TV", follow by "send to my phone". You phone should have new notification from google assistant, with the keyword you speak before that command. Put this notification as the trigger and execute this flow and finally remove the notification.

5. You can even extend this by using control UI coupled with google assistant to send the broadcast command back to google home, to report the command has been executed, as in here : viewtopic.php?f=4&t=7489

BTW, I don't have google home (and the TV), so I can't test it out. If there is error, you can post it here to see if we can spot the problem.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

oliver7
Posts: 8
Joined: 17 Jul 2018 16:56
Contact:

Re: HTTP POST request

Post by oliver7 » 18 Jul 2018 15:04

@Desmanto
Thx for your efforts. See attached screenshots. It doesn't work yet. 404 not found. Must be a wrong path?! [how can I find out the path to /remote?]
Yes. Source is as you mentioned above.

It has to work somehow.. because there's a Telefunken remote app ('Smart Remote' by Cabot Comm. Ltd.) and I can entirely control the tv using it.
I decompiled the app but didn't find e.g. the /path or port.

Btw. I have already access to turn on the tv via my phone using UDP to send magic packet to WakeonLan/WOL.
CEC to switch off does also work, but only if tv source=chromecast (so it doesn't make sense..).
Thx again!!!!!!

[scr.shots with false info removed by me]
Last edited by oliver7 on 19 Jul 2018 16:58, edited 2 times in total.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: HTTP POST request

Post by Desmanto » 18 Jul 2018 17:46

404 path not found. It seems that you have extra slash after the remote.
I think it should be

Code: Select all

http://192.168.1.137:56789/apps/vr/remote
Without the last slash /

And you might need to try first without your vpn (it seems you are connected to some vpn). Or at least configure it to bypass vpn for local network traffic.

And for the Daten, the Code: should not be include, that is the forum tag :)
So the text field in Daten, start only with <?xml ......

It is quite difficult to scan the app for strings, it is better to upload the apk to virustotal.com and inspect the result strings.

Chromecast is the workaround, so leave it as the last resort after you can't solve this one.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

oliver7
Posts: 8
Joined: 17 Jul 2018 16:56
Contact:

Re: HTTP POST request

Post by oliver7 » 18 Jul 2018 19:20

I corrected url and data. Still doesn't work.

How does the remote app do it? That is the question.. The app finds my tv and gains total control. :roll: VPN is just NetGuard.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: HTTP POST request

Post by Desmanto » 19 Jul 2018 17:20

Do you still get the 404 error? It seems the path is different at your TV. Maybe there is a variation with newer firmware or different model. Try to turn off the VPN when you test the http post.

If you want ot check that app, you need to wireshark the connection, a bit difficult to setup. You need a laptop (or PC with wifi) as the logger. Both your tv and phone should connect to the laptop wifi hotspot and then use wireshark to log the connection between the phone and tv. Save it for later research. After you find the http url, you can mimic the capability in automagic. That's how I find the proper json to reboot my wifi router, which doesn't support automation at all. But it is easier at my part, since my PC is connected directly to the router, I can issue command from there directly.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

oliver7
Posts: 8
Joined: 17 Jul 2018 16:56
Contact:

Re: HTTP POST request

Post by oliver7 » 19 Jul 2018 18:40

Yes, apparently I gotta find out the correct path to /remote like the source did (https://thomaskekeisen.de/resources/tel ... chnitt.png), and hopefully that still exists for my tv. Yes, it's hard to set up sniffers, and there's no more info on the internet, and the Telefunken remote app does it all easily (even with VPN on).. It's more complicated than I thought.

Post Reply