MagentaTV Binding for Deutsche Telekom MR 4xx

I don’t know, just give it a try. Set log to TRACE level, I think I need to add a model ID so it gets discovered, you may could try to add the thing manually. Once this is done we’ll see if it provides the same interface, otherwise I can’t support it.

I’ve tried it and get an credentials error - like this:
FATAL: Communication Error - OAuth failed: Can’t get credentials.

are you using the latest build?
you have to use the email address and password as you use it in the Telekom Kundencenter

I updated the DEV build to include some requested changes from PR process

  • An openHAB console command “smarthome:magentatv login” has been implemented to generate the UID (userID) required for the pairing with the receiver
  • You could now generate the UID by entering the credentials in the thing configuration (as before) for directly inserting the userId generated by the console command (for security reasons, in this case the credentials are never stored in the thing config).
  • Therefore accountName, accountPassword and userId are no longer mandantory (you have the choice how to configure the thing).
  • Configuration parameter modelId has been removed (no longer required) and port can now be empty (uses default depending on model)

Refer to the updated README for a dewscription of the new console command.

Please help hardening this release so it goes into the upcoming 2.5.9 Addon release. @Kai already started the PR review. Please perform the following test

Test 1:

  • remove existing MagentaTV thing(s)
  • run a new discover, add thing from the Inbox
  • the thing should show status OFFLINE and indicates missing configuration data (credentials or UID)
  • Edit thing config and set your credentials
  • after 5sec the thing should be ONLINE and working as expected

Test 2:

  • Remove the thing, re-discover, add thing.
  • Open OH console and run “smarthome:magentatv login”, enter credentials
  • You should receive the UID (a hex strong)
  • Edit thing config and fill in the UID, save
  • After 5sec the thing should get ONLINE and works as expected
    I added MR601 to the list of supported models. However, due to the fact that I don’t have one I could not verify this. Is there anyone who could give it a try and report the results?

Please note: Version has changed to 2.5.9, you need to delete the old version before installing the new one.

2 Likes

I need a sitemap example for the README. Who could provide one?
(I’m using HABpanel and have no sitemaps at all)

PR is making good progress, most changes are already done

Maybe this helps a little bit

        Text label="TV" icon="it_television" {

            Frame label="Bedienung"  {
                Switch item=RB_GF_LR_TVReceiver_Power label="Ein/Aus []" icon="control_on_off" mappings=[ ON="Ein/Aus" ]
                Default item=RB_GF_LR_TVReceiver_Control label="Player []" icon=""
                Switch item=RB_GF_LR_TVReceiver_Key label="Lautstärke []" icon="audio_volume_high" mappings=[ "VOLUP"="˄", "VOLDOWN"="˅" ]
                Slider item=RB_GF_LR_TVReceiver_Volume label="Lautstärke [%d %%]" icon="audio_volume_high"
                Switch item=RB_GF_LR_TVReceiver_Key label="Programm []" icon="audio_playlist" mappings=[ "CHUP"="˄", "CHDOWN"="˅" ]
                Selection item=RB_GF_LR_TVReceiver_Channel label="Kanal [%s]" icon="audio_playlist" mappings=[ 1="ARD", 2="ZDF", 3="RTL", 4="SAT.1", 5="ProSieben", 6="VOX" ]
                Switch item=RB_GF_LR_TVReceiver_Mute label="Mute []" icon="audio_volume_mute" mappings=[ ON="mute", OFF="unmute" ]
            }
            Frame label="Aktuelles Programm" {
                Text item=RB_GF_LR_TVReceiver_ProgTitle label="Sendung [%s]" icon="it_television"
                Text item=RB_GF_LR_TVReceiver_ProgDescription label="Beschreibung [%s]" icon="it_television"
                Text item=RB_GF_LR_TVReceiver_ProgStart label="Start [%1$td.%1$tm.%1$ty %1$tH:%1$tM]" icon="time_clock"
                Text item=RB_GF_LR_TVReceiver_ProgDuration label="Dauer [%d min.]" icon="time_clock"
                Text item=RB_GF_LR_TVReceiver_PlayPosition label="Position [%d min.]" icon="it_television"
                Text item=RB_GF_LR_TVReceiver_PlayMode label="Mode [%s]" icon="it_television"
            }

        }

perfect

do you also have a textual thing and item config, witch matches to the sitemap?

Thing definition not, but items yes

// RB_GF_LR_TVReceiver - DMS_XXXXXXXXXXX
    Group					gRB_GF_LR_TVReceiver
                            "RB_GF_LR: TV Receiver"
                            <it_television>
                            (gRB_GF_LivingRoom, gMedia, gSpeechCmnd)

    Switch					RB_GF_LR_TVReceiver_Power
                            "RB_GF_LR: TV Receiver power [MAP(i18n_switch.map):%s]"
                            <control_on_off>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:control#power"}

    Player					RB_GF_LR_TVReceiver_Control
                            "RB_GF_LR: TV Receiver control"
                            <audio_play>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:control#player"}

    Switch					RB_GF_LR_TVReceiver_Mute
                            "RB_GF_LR: TV Receiver mute [MAP(i18n_switch.map):%s]"
                            <audio_volume_mute>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:control#mute"}

    Number					RB_GF_LR_TVReceiver_Channel
                            "RB_GF_LR: TV Receiver Channel"
                            <audio_playlist>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:control#channel"}

    String					RB_GF_LR_TVReceiver_Key
                            "RB_GF_LR: TV Receiver Key"
                            <edit_input_numeric>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:control#key"}

    String					RB_GF_LR_TVReceiver_ProgTitle
                            "Label [%s]"
                            <text>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:program#title"}

    String					RB_GF_LR_TVReceiver_ProgDescription
                            "Label [%s]"
                            <text>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:program#text"}

    DateTime				RB_GF_LR_TVReceiver_ProgStart
                            "Label [%1$td.%1$tm.%1$ty %1$tH:%1$tM]"
                            <text>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:program#start"}

    Number:Time	            RB_GF_LR_TVReceiver_ProgDuration
                            "Label [%d min]"
                            <text>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:program#duration"}

    Number:Time			    RB_GF_LR_TVReceiver_PlayPosition
                            "Label [%d min.]"
                            <text>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:program#position"}

    String					RB_GF_LR_TVReceiver_PlayMode
                            "Label [%s]"
                            <text>
                            (gRB_GF_LR_TVReceiver)
                            {channel="magentatv:receiver:XXXXXXXXXXX:status#playMode"}

cool :+1:

Could you please give the updated build a try (just uploaded)

  • general function
  • perform the tests described above
  • review the README

The were various changes driven by the review. Function should be the same (except the changes described above, e.g. modelId removed from parameters).

At the end: If should work like the old version with. Setup of the User ID follows a new concept (now optional parameters + new console command), but everything should work like before.

Nobody able to test and provide feedback?!
@thaake @Dibbler42 @MHerbst @kugelsicha could you support with some testing?

The PR is ready to merge, but I want to have some feedback fro the community to make sure that it’s working in different installations.

I will try it this evening. First feedback in openHAB3 it did not work :slight_smile:

Didnt have had time to play with it the last days…

but its on my ToDo and hopefully will be able to do it this weekend… will report if everything is fine.

Thanks for your work and to get this into the official Addons :slight_smile:

Will try it tomorrow

I have tried it in a fresh OH installation. I was unable to retrieve a user id from the Telekom server. I always got TimeoutException.

Then I have copied the user id from my production environment and it worked.

In my first test I discovered only one problem: the channel “channel” and the channels for program information and status were not set after. After switching to another channel on the Magenta TV they were correctly updated.

Key Codes are working. Only entering a PIN was not possible because there are not keys to enter numbers.

This has to work and is an essential function. Did you tried the “smarthome:magentatv login” console command and/or setting the credentials in the thing config?
Could you please provide a DEBUG log

That’s normal. The MR does not send the event report when powered on, only when the channel is changed. There is no work around,

Just send key string “0” or “0123”
If you want I could include “0”=“0”, “1”=“1”… as option, but I think that’s overdriven

Guys, I need your feedback. The PR is going to be merged, but I want to make sure that the initial release nit just works in my setup

You are right. I tested it only in Paper UI and there I “only” have the list of predefined values.

I tried the console command.

Here is the DEBUG output:

2020-09-12 18:30:52.644 [INFO ] [atv.internal.MagentaTVConsoleHandler] - Performing OAuth for user xxx@t-online.de
2020-09-12 18:30:52.646 [DEBUG] [tatv.internal.network.MagentaTVOAuth] - Authenticate with account xxx@t-online.de
2020-09-12 18:30:53.493 [DEBUG] [tatv.internal.network.MagentaTVOAuth] - epghttpsurl = https://appepmfk20003.prod.sngtv.t-online.de:33227/EPG
2020-09-12 18:30:53.495 [DEBUG] [tatv.internal.network.MagentaTVOAuth] - get token from https://accounts.login.idm.telekom.com/oauth2/tokens
2020-09-12 18:30:53.638 [DEBUG] [tatv.internal.network.MagentaTVOAuth] - HTTP POST https://web.magentatv.de/EPG/JSON/DTAuthenticate?SID=user&T=Mac_chrome_81, postData={"userType":1,"terminalid":"t_c88d1b38e071187ac6179da11daaaaaaa","mac":"t_c88d1b38e071187ac6179da11daaaaaaa","terminaltype":"MACWEBTV","utcEnable":1,"timezone":"Europe/Berlin","terminalDetail":[{"key":"GUID","value":"t_c88d1b38e071187ac6179da11d7157b2"},{"key":"HardwareSupplier","value":""},{"key":"DeviceClass","value":"PC"},{"key":"DeviceStorage","value":"1"},{"key":"DeviceStorageSize","value":""}],"softwareVersion":"","osversion":"","terminalvendor":"Unknown","caDeviceInfo":[{"caDeviceType":6,"caDeviceId":"t_c88d1b38e071187ac6179da11d7157b2"}],"accessToken":"EKD_asdasdpMwQ3sqGhz4AAEHpQAAAXSDJ7yzAAABdIOVmbMBAAgAAAF0gye8s-Im9glCD7ymcyWikofLRnfH7jdVfs_kz0JrdA2LYsEtCzuc6vTvokIVpt8yCAO_LGK4eBhOh2P4ngP8eyU8FWEXyoViRwvCpxXqfWJXbO6LMIjFfMYPsTgPWUG0dn-9M7H7rpsQMr6ynZlHRKD4TdYtDaI49QpntpB_LskgcEp1JudNHOH36roibCcDPa-I3YeCy6w=","preSharedKeyID":"PC01P00002","cnonce":"167d301bccbf2ce48e0bf9df29517b4d"}
2020-09-12 18:30:56.642 [WARN ] [atv.internal.MagentaTVConsoleHandler] - Unable to login with  account xxx@t-online.de, check credentials (Unable to authenticate xxx@t-online.de: get token failed; serviceURL=https://accounts.login.idm.telekom.com, rc=/, response={"access_token":"EKD_asdasdpMwQ3sqGhz4AAEHpQAAAXSDJ7yzAAABdIOVmbMBAAgAAAF0gye8s-Im9glCD7ymcyWikofLRnfH7jdVfs_kz0JrdA2LYsEtCzuc6vTvokIVpt8yCAO_LGK4eBhOh2P4ngP8eyU8FWEXyoViRwvCpxXqfWJXbO6LMIjFfMYPsTgPWUG0dn-9M7H7rpsQMr6ynZlHRKD4TdYtDaI49QpntpB_LskgcEp1JudNHOH36roibCcDPa-I3YeCy6w="","expires_in":7200,"refresh_token":"RT2:63802551-ed23-4b73-b8a2-ecac4acaf23f:33ebc514-fbeb-4cff-84dd-7b711ac55535","scope":"ngtvepg","token_type":"Bearer"} (class java.io.IOException: java.util.concurrent.TimeoutException: Total timeout 3000 ms elapsed))

Sorry i tried it today, but my receiver is not working properly, because i am moving over to vodafone (1GBPS compared to 70MBPS for the same prime). I am kind of in between.

Maybe i find tomorrow the time to fix things

Hmm, it seems that the access_token is empty, however, the response JSON includes access_token

Please try the updated build, I adjusted debugging and made a change

I tried the latest version on a fresh openhabian install…
no other bindings/things/items installed…

after entering my credentials… the thing went online…

But i havent had time to use items and controls yet…