MagentaTV Binding for Deutsche Telekom MR 4xx

Hi,
If i try to enter the credential via console the chars are not displayed or better, some are displayed, some other not. And if it stop, then nothing goes forward anymore. and if I tried to use copy and paste only a D or DD will be dispalyed. At the moment I have no chance to get my ID from Magenta on this way. I use Putty for remote access. The Magenta Binding is installed from OH 2.5.10 binding list (I use OH 2.5.10). OS Raspberry OS PI4.

best, Chris

I don’t know what could case the issue, but I def. tried that function and it worked. Smells that you remote connection has issues - maybe just on the OH console? You could also set the credentials in the thing config. They will be used only once. Then result will be writte to the userId field an then credentials are replace with “***” in the thing config, so not store permanently once the userId is generated.

Hi Markus,

thanks for you answer, remote access works perfect in all other cases, ssh and rdp. Only in this case I must enter each character very often. the result is then very strange. I suspect that there is something with the input in the console strange.

Maybe, OH find the device and I found a blog entry that I muste enter my credentials and then the pairing works too via this way. But the things are status offline - communication error. Here I found a hint earlier in this chat.

I remove the things and add it again, with the testing my account was locked but this is solved now too.

From my end it works now, many thanks !

best regards,
Christian

:+1:

Thanks. This was clear to me. But I wondered which transformations I need to put into the file, or if the file is somewhere available?

Could you please help me? I put the following into a file named “i18n_switch.map” in the transform folder.

on=ein
off=aus
OFF=aus
ON=ein
NULL=undefiniert
ein=ON
aus=OFF
=default

But I still get errors like:
2020-11-29 14:27:09.233 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state ‘NULL’ on item ‘RB_GF_LR_TVReceiver_Mute’ with pattern ‘MAP(i18n_switch.map):%s’: Couldn’t transform value because transformation service of type ‘MAP’ is not available.

2020-11-29 14:27:09.336 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state ‘OFF’ on item ‘RB_GF_LR_TVReceiver_Power’ with pattern ‘MAP(i18n_switch.map):%s’: Couldn’t transform value because transformation service of type ‘MAP’ is not available.

fyi: On 12/5 we’ll have a Virtual Teamup

The following topics will be presented:

  • The Past, the Present and the Future
  • A Tour of the New openHAB 3 UI
  • openHABian Update
  • Bayesian Presence Detection
  • Innovative input devices for openHAB

More: openHAB Virtual Meetup December 5th (Updated)

Can you share how to achive this?
Many thanks!

Hi all, I hope you hade a nice Xmas.

I’ve updated the DEV build to include the fix for MR400 discovery (port needs to change to 49152 on discovery). The new build is available for 2.5.x and 3.x users.


2.5.12 - 3.1.0 - README - How to install the DEV Build

Hello Markus 7017,

I made a new topic in january (MagentaTV - Binding Problems).

My problem is described there. Another one seems to have problems, too.

I am unable to receive the UID. Can you help us?

Ty

Hello everyone,

as suggested by @markus7017 i move the Topic to the mainthread:

[Daruby]

Hey guys,

at the moment I’m trying to include the MagentaTV binding Version 3.0.0 with Openhab3.

Everything else is working properly.

What happened?

  1. Installed the binding -> no problem
  2. MediaReceiver (401B) was found in INBOX and added -> still no problem
  3. configured the MediaReceiver (login-name and passwort) -> Status unknown.

Whatever I do, I can’t get the receiver in a working state.
If I send a command: -> “Channel operation failed (command=ON, value=control#mute): Pairing failed, result=-2”

The Thing is not able to connect and receive an UID. If I login in console and try to get an UID I always get the error: “An unexpected error occurred during execution.”

If I use a wrong Email or Password a different error occures. My Email is correct but its a gmail and not a t-mobile or t-online. I can log in into the customer center without any problem.

I read the documentation and a few posts in the forum. I think I have done everything correctly. Did I miss something?

Would be awesome if any1 could help me :slight_smile:

[Ronald_Schulz]

plus one - I have the same issue and can not find the solution :confused:

[bknow]

Hello Guys,

same for me. Also have a MR401B. And i get no UID via:

  • OpenHab UI
  • OpenHab Console
  • magentaTV Node.js Application
  • magentaTV bash script

Nothing works. Even in Wireshark i cannot see a userID. If i search for <userID> i get nothing. If i search for userID i get an empty field:
<name> userID </name>

Tried with Version:

  • The one which get installed via OpenHab UI
  • 3.0.0 (manuall installation)
  • 3.1.0 (manuall installation)

Also i have installed openHab on a Raspberry PI 4 and a x86_64 PC. Nothing works, same errors as reported.

enable the DEBUG log and post the thing initialization, also tr putting the credentials directly in the thing config

is you email @t-online.de?
do you have special chars in your password?

Hi Markus. I’m quite new to OH. How I can enable debug?

About the email, yes it’s @t-online.de (tried also another one) but with the password you can be right - there is a ‘!’ inside. I’ll change and check tomorrow about any new behavior.

Hey Markus,

thanks for answering. So lett answer your questions:

  1. Yes i have a @t-online.de email address. I also deleted every other email address in the “Kundencenter”
  2. My password contains capital letters, small letters and numbers
  3. Here is the output from the log:
    06:29:15.771 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'receiver.things' 06:29:16.009 [DEBUG] [re.model.rule.jvmmodel.RulesRefresher] - Thing "magentatv:receiver:XXXUDNHEREXXX" added => rules are going to be refreshed 06:29:16.016 [DEBUG] [tatv.internal.MagentaTVHandlerFactory] - Create thing type magentatv:receiver 06:29:16.027 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'magentatv:receiver:XXXUDNHEREXXX' changed from UNINITIALIZED to INITIALIZING 06:29:16.043 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'magentatv:receiver:XXXUDNHEREXXX' changed from INITIALIZING to UNKNOWN 06:29:17.044 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'receiver.things' 06:29:21.043 [DEBUG] [atv.internal.handler.MagentaTVHandler] - ReceiverWohnzimmer: Login with account mymailadress@t-online.de 06:29:21.047 [DEBUG] [ntatv.internal.network.MagentaTVOAuth] - Authenticate with account mymailadress@t-online.de 06:29:21.350 [DEBUG] [ntatv.internal.network.MagentaTVOAuth] - epghttpsurl = https://appepmfk10006.prod.sngtv.t-online.de:33227/EPG 06:29:21.354 [DEBUG] [ntatv.internal.network.MagentaTVOAuth] - get token from https://accounts.login.idm.telekom.com/oauth2/tokens 06:29:21.577 [DEBUG] [ntatv.internal.network.MagentaTVOAuth] - HTTP POST https://web.magentatv.de/EPG/JSON/DTAuthenticate?SID=user&T=Mac_chrome_81, postData={"userType":1,"terminalid":"t_79eaddc485bb633b6fdb79c408565d29","mac":"t_79eaddc485bb633b6fdb79c408565d29","terminaltype":"MACWEBTV","utcEnable":1,"timezone":"Europe/Berlin","terminalDetail":[{"key":"GUID","value":"t_79eaddc485bb633b6fdb79c408565d29"},{"key":"HardwareSupplier","value":""},{"key":"DeviceClass","value":"PC"},{"key":"DeviceStorage","value":"1"},{"key":"DeviceStorageSize","value":""}],"softwareVersion":"","osversion":"","terminalvendor":"Unknown","caDeviceInfo":[{"caDeviceType":6,"caDeviceId":"t_79eaddc485bb633b6fdb79c408565d29"}],"accessToken":"EKApDe3wNGpDGrxmOjJqyFcJAAEHpQAAAXeZ3W2QAAABd5pLSpABAAgAAAF3md1tkHETKTz2R9QBsuwQ4PXYl_FfQy4Ojw10NLNCKZ7g8uxjGlO9Z01e2GYEH5qwn4Xh1LV4NFYkaPxtpdr_cOxFKxcR9mthLDdIITgL6IAdcWvYo2CAK77XpC4Khsxm2inbYV_uqujwNMN6nGAlxHuJrzkdvfaJzcv4vzIIhnCWcLLWMNHFW1IpfHthnkUvY3d77RSgIkE=","preSharedKeyID":"PC01P00002","cnonce":"555b99e1d7d1a94ee5261e65413ed8e6"} 06:29:21.769 [WARN ] [atv.internal.handler.MagentaTVHandler] - ReceiverWohnzimmer: Exception on initialization com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224) ~[bundleFile:?] at com.google.gson.Gson.fromJson(Gson.java:888) ~[bundleFile:?] at com.google.gson.Gson.fromJson(Gson.java:853) ~[bundleFile:?] at com.google.gson.Gson.fromJson(Gson.java:802) ~[bundleFile:?] at com.google.gson.Gson.fromJson(Gson.java:774) ~[bundleFile:?] at org.openhab.binding.magentatv.internal.network.MagentaTVOAuth.getUserId(MagentaTVOAuth.java:168) ~[bundleFile:?] at org.openhab.binding.magentatv.internal.handler.MagentaTVControl.getUserId(MagentaTVControl.java:91) ~[bundleFile:?] at org.openhab.binding.magentatv.internal.handler.MagentaTVHandler.getUserId(MagentaTVHandler.java:347) ~[bundleFile:?] at org.openhab.binding.magentatv.internal.handler.MagentaTVHandler.initializeThing(MagentaTVHandler.java:165) [bundleFile:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) ~[bundleFile:?] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213) ~[bundleFile:?] ... 14 more

@Ronald_Schulz you can enable the DEBUG log in the OH console.:

  1. openhab> list -s | grep magenta
    235 │ Active │ 80 │ 3.1.0.202012271200 │ org.openhab.binding.magentatv
  2. openhab> log:set DEBUG org.openhab.binding.magentatv
  3. openhab> log:tail

for more information see here

as expected I see an exception
Could you please do the same with TRACE level than we see the http response, which can‘t be parsed and lead into a JSON exception

sure, there you go: (sorry for the formatting, after the hmtl tag it get not better)

14:06:33.593 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'receiver.things' 14:06:33.668 [DEBUG] [re.model.rule.jvmmodel.RulesRefresher] - Thing "magentatv:receiver:wohnzimmer" added => rules are going to be refreshed 14:06:33.675 [DEBUG] [tatv.internal.MagentaTVHandlerFactory] - Create thing type magentatv:receiver 14:06:33.693 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'magentatv:receiver:wohnzimmer' changed from UNINITIALIZED to INITIALIZING 14:06:33.707 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'magentatv:receiver:wohnzimmer' changed from INITIALIZING to UNKNOWN 14:06:38.705 [DEBUG] [atv.internal.handler.MagentaTVHandler] - ReceiverWohnzimmer: Login with account mymailadress@t-online.de 14:06:38.707 [DEBUG] [ntatv.internal.network.MagentaTVOAuth] - Authenticate with account mymailadress@t-online.de 14:06:38.712 [TRACE] [ntatv.internal.network.MagentaTVOAuth] - get credentials from https://slbedmfk11100.prod.sngtv.t-online.de:33428/EDS/JSON/Login?UserID=Guest 14:06:39.092 [TRACE] [ntatv.internal.network.MagentaTVOAuth] - http response = {"enctytoken":"2709F0FE1D9963BDD8ECEF2FF5E2F75","encryptiontype":"0002","platformcode":"0200","epgurl":"http://appepmfk20003.prod.sngtv.t-online.de:33220","version":"MEM V200R008C18SPC100B063","epghttpsurl":"https://appepmfk20003.prod.sngtv.t-online.de:33227","rootCerAddr":"http://appepmfk20003.prod.sngtv.t-online.de:33220/EPG/CA/iptv_ca.der","upgAddr4IPTV":"https://slbedifk11100.prod.sngtv.t-online.de:33428/EDS/jsp/upgrade.jsp","upgAddr4OTT":"https://slbedmfk11100.prod.sngtv.t-online.de:33428/EDS/jsp/upgrade.jsp,https://slbedmfk11100.prod.sngtv.t-online.de:33428/EDS/jsp/upgrade.jsp","EPGDomainNameList":[{"key":"2","value":"appepmfk20003.prod.sngtv.t-online.de"},{"key":"3","value":"62.155.248.117"},{"key":"4","value":"62.155.248.117"},{"key":"5","value":"62.155.248.117"},{"key":"6","value":"62.155.248.117"},{"key":"7","value":"62.155.248.117"}],"sam3Para":[{"key":"SAM3ServiceURL","value":"https://accounts.login.idm.telekom.com"},{"key":"OAuthScope","value":"ngtvepg"}]} 14:06:39.105 [DEBUG] [ntatv.internal.network.MagentaTVOAuth] - epghttpsurl = https://appepmfk20003.prod.sngtv.t-online.de:33227/EPG 14:06:39.107 [TRACE] [ntatv.internal.network.MagentaTVOAuth] - sam3Para.SAM3ServiceURL = https://accounts.login.idm.telekom.com 14:06:39.109 [TRACE] [ntatv.internal.network.MagentaTVOAuth] - sam3Para.OAuthScope = ngtvepg 14:06:39.113 [DEBUG] [ntatv.internal.network.MagentaTVOAuth] - get token from https://accounts.login.idm.telekom.com/oauth2/tokens 14:06:39.351 [TRACE] [ntatv.internal.network.MagentaTVOAuth] - http response={"access_token":"EKCisU6j2B1Mopce0Um0eRzzAAEHpQAAAXebgBhgAAABd5vt9WABAAgAAAF3m4AYYIFZavQpJNICgdayD4nRXxy1l7kngN5PMmahoROb6HMIHkVhjETbUN_F99cTE0qLqshQap3WoshBDbQFAT1mlV9pCPU9xZ9CgCnRSaBkcIcHMJYMPduIYgOHoGLnB9OANelv-BZKFwJI-X_T9w_MDOsEJRWsO5ABtn19mY-MU0IRfuyLdYQwHlJsMSMpCBSkfEla3-U=","expires_in":7200,"refresh_token":"RT2:71dbc7f8-7ed7-47dd-9a97-a805e4500eb3:4b5b578b-fe3f-429a-bf3f-4c8f8571e875","scope":"ngtvepg","token_type":"Bearer"} 14:06:39.358 [DEBUG] [ntatv.internal.network.MagentaTVOAuth] - HTTP POST https://web.magentatv.de/EPG/JSON/DTAuthenticate?SID=user&T=Mac_chrome_81, postData={"userType":1,"terminalid":"t_79eaddc485bb633b6fdb79c408565d29","mac":"t_79eaddc485bb633b6fdb79c408565d29","terminaltype":"MACWEBTV","utcEnable":1,"timezone":"Europe/Berlin","terminalDetail":[{"key":"GUID","value":"t_79eaddc485bb633b6fdb79c408565d29"},{"key":"HardwareSupplier","value":""},{"key":"DeviceClass","value":"PC"},{"key":"DeviceStorage","value":"1"},{"key":"DeviceStorageSize","value":""}],"softwareVersion":"","osversion":"","terminalvendor":"Unknown","caDeviceInfo":[{"caDeviceType":6,"caDeviceId":"t_79eaddc485bb633b6fdb79c408565d29"}],"accessToken":"EKCisU6j2B1Mopce0Um0eRzzAAEHpQAAAXebgBhgAAABd5vt9WABAAgAAAF3m4AYYIFZavQpJNICgdayD4nRXxy1l7kngN5PMmahoROb6HMIHkVhjETbUN_F99cTE0qLqshQap3WoshBDbQFAT1mlV9pCPU9xZ9CgCnRSaBkcIcHMJYMPduIYgOHoGLnB9OANelv-BZKFwJI-X_T9w_MDOsEJRWsO5ABtn19mY-MU0IRfuyLdYQwHlJsMSMpCBSkfEla3-U=","preSharedKeyID":"PC01P00002","cnonce":"7d2d324267b23a28a9589321d1ea2080"} 14:06:39.534 [TRACE] [ntatv.internal.network.MagentaTVOAuth] - http response=<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

421 Misdirected Request

Misdirected Request

The client needs a new connection for this request as the requested host name does not match the Server Name Indication (SNI) in use for this connection.

14:06:39.541 [WARN ] [atv.internal.handler.MagentaTVHandler] - ReceiverWohnzimmer: Exception on initialization com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at `com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224) ~[bundleFile:?] at com.google.gson.Gson.fromJson(Gson.java:888) ~[bundleFile:?] at com.google.gson.Gson.fromJson(Gson.java:853) ~[bundleFile:?] at com.google.gson.Gson.fromJson(Gson.java:802) ~[bundleFile:?] at com.google.gson.Gson.fromJson(Gson.java:774) ~[bundleFile:?] at org.openhab.binding.magentatv.internal.network.MagentaTVOAuth.getUserId(MagentaTVOAuth.java:168) ~[bundleFile:?] at org.openhab.binding.magentatv.internal.handler.MagentaTVControl.getUserId(MagentaTVControl.java:91) ~[bundleFile:?] at org.openhab.binding.magentatv.internal.handler.MagentaTVHandler.getUserId(MagentaTVHandler.java:347) ~[bundleFile:?] at org.openhab.binding.magentatv.internal.handler.MagentaTVHandler.initializeThing(MagentaTVHandler.java:165) [bundleFile:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) ~[bundleFile:?] at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213) ~[bundleFile:?] ... 14 more`

Hello, I’ve got the same problem. Unfortunately, deleting and re-embedding does not work. Email and password are correct. Has anyone found a solution yet?

It seems that Telekom again changed something with the authentication flow I need to analyse. However at the moment I’m pretty busy. I try to find a slot the next days.

Option B:
A longer time ago I posted information who to get the UID from a Wireshark trace. This can then be copied to the thing configuration and bypasses the authentication problem. In generel there are 2 components

  1. Authenticate on the Telekom portal with the credentials and get the UID
  2. Use UID to pair with the receiver

This “bypass” skips step 1 and directly starts with pairing. As said, it’s somewhere in this thread and maybe hard to find.

1 Like

Hello Markus, thank you for the quick answer. Unfortunately I haven’t found it yet, but I would of course be happy to find a solution. Stay healthy.

hello together, I found the description for the Wireshark option:

got a “uuid” but not as described when seraching for “UserID” in the following section:

Hypertext Transfer Protocol
    HTTP/1.1 200 OK\r\n
        [Expert Info (Chat/Sequence): HTTP/1.1 200 OK\r\n]
            [HTTP/1.1 200 OK\r\n]
            [Severity level: Chat]
            [Group: Sequence]
        Response Version: HTTP/1.1
        Status Code: 200
        [Status Code Description: OK]
        Response Phrase: OK
    DATE: Wed, 24 Feb 2021 11:39:12 GMT\r\n
    SERVER: Linux/ UPnP/1.0 HUAWEI_iCOS/iCOS V1R1C00\r\n
    CONTENT-LENGTH: 0\r\n
        [Content length: 0]
    X-User-Agent: redsonic\r\n
    SID: uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx\r\n
    TIMEOUT: Second-300\r\n
    CONNECTION: close\r\n
    \r\n
    [HTTP response 1/1]

But what should I say… step by step… I 're-bind" the Magenta-TV by adding this new uuid (without the dashes) to the settings.

Now I got a new Error Message:

2021-02-24 13:03:38.431 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'magentatv:receiver:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): org.openhab.binding.magentatv.internal.MagentaTVException: Pairing failed, result=-2

I also tried with dashes an other Ports… does not work :confused:

Hello Ronald, yes I tried yesterday, but also got no userID. Just the UUID. I have the feeling that Telekom is preventing you from getting a filled POST. Is that on purpose ???
But Markus had written that he will try to see it in the next few days as soon as he finds the time.
Greeting

1 Like