MagentaTV Binding for Deutsche Telekom MR 4xx

you could use tcpdump to create the eth file, which then can get loaded in Wireshark
@Mat_Ias is working on an automation of that process (script for now, which then could be implemented in the binding)

@markus7017 Thanks for the info with the 404-error. I was unable to reproduce the error. I changed the script so that in debug-mode it outputs the POST-Payload in the last step “Authenticate MobileDevice”. Could you give it a try and send me the output of the last step, including the POST-Payload?

getEntertainTVUserID.sh.pdf (5.2 KB)

1 Like

@markus7017 I installed your updated version. How do I get to see the status informations like in your screenshot: “Description”, “Play mode” oder “Program”? I only the see the attached channels

you need to press chup or chdown or play a video. this triggers an event from the stb (at least my mr401 does). you should get an update wirh every program change; check the DEBUG log

Yes, indeed: Example: EntertainTV: Unable to process STB event: null, JSON=’{“new_play_mode”:20,“mediaCode”:“3634”,“playBackState”:1,“mediaType”:1,“fastSpeed”:1}’

How do I process these events? With Event-based Triggers in rules?

hm, in fact that is an exception. I think I need to check if all parameters I want to fetch from JSON
I’ll have a look when I’m at homr

do you see other events?

No, in fact the event messages also don’t appear anymore. Now no events at all. In Karaf I set log:set DEBUG org.openhab.binding.entertaintv

my device is recognized as MR401B

try to restart OH or the binding. I already noticed that sometimes the pairing status gets lost and the stb stops sending events

Great, thanks. A restart helped. Can you give me a hint on how to process these events.

the. are processed by the binding and them mapped to the various cjannels. the item could trigger a rule if you want to do more

@Mat_Ias try this build, this should fix the exception problem
https://github.com/markus7017/org.openhab.binding.entertaintv/blob/master/target/org.openhab.binding.entertaintv-2.4.0-SNAPSHOT.jar

@Mat_Ias you made it. This version of the script returned the right userID.

@Sebastian_Kastner try the script to find out our user id

getEntertainTVUserID.sh <user@t-online.de> <password>

Ignore the debug output. If the script is successful you’ll see

UserID: XXXXXXXXXXXXXXXXXXXXX
UserID (MD5ed): HHHHHHHHHHHHHHHHHHHH

use the hashed value to configure the binding.

Excellent work @Mat_Ias, I get the correct UserID.

Hello,

As promised, I tried the binding this evening.
I used the Binding for OpenHAB 2.3. I tested the autodiscover for MR401 and MR400.

Results:

After loading the binding:

==> /var/log/openhab2/openhab.log <==
2018-10-16 09:56:45.579 [ERROR] [very.EntertainTVDiscoveryParticipant] - EntertainTV: Unable to create thing: null
2018-10-16 09:56:45.595 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ to inbox.
==> /var/log/openhab2/events.log <==
2018-10-16 09:56:45.598 [home.event.InboxAddedEvent] - Discovery Result with UID ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ has been added.
==> /var/log/openhab2/openhab.log <==
2018-10-16 09:56:45.603 [ERROR] [very.EntertainTVDiscoveryParticipant] - EntertainTV: Unable to create thing: null
==> /var/log/openhab2/events.log <==
2018-10-16 09:56:45.642 [home.event.InboxAddedEvent] - Discovery Result with UID ‘entertaintv:receiver:bb5e21ce-2222-11b2-f918-AC6FBB2F1EC4’ has been added.
==> /var/log/openhab2/openhab.log <==
2018-10-16 09:56:45.639 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing ‘entertaintv:receiver:bb5e21ce-2222-11b2-f918-AC6FBB2F1EC4’ to inbox.
2018-10-16 09:56:45.848 [INFO ] [tv.internal.EntertainTVNotifyServlet] - EntertainTV servlet started at ‘/entertaintv/notify’

That worked so far

Then I started to add the thing of the MR401 (not yet saved), in the logfile it appeared:

2018-10-16 09:58:03.080 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: entertaintv:playStatus
2018-10-16 09:58:17.253 [WARN ] [re.thing.internal.ThingFactoryHelper] - Could not create channel ‘playStatus’ for thing type ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’, because channel type ‘entertaintv:playStatus’ could not be found.
==> /var/log/openhab2/events.log <==
2018-10-16 09:58:17.291 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ has been removed.
2018-10-16 09:58:17.313 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_CONFIGURATION_PENDING)
==> /var/log/openhab2/openhab.log <==
2018-10-16 09:58:21.164 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: entertaintv:playStatus

This worked so far, until the missing channel “playStatus”.
The receiver model was detected automatically (MR401B).

Then the thing was saved:

==> /var/log/openhab2/events.log <==
2018-10-16 09:59:14.414 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to UNINITIALIZED (HANDLER_MISSING_ERROR)
2018-10-16 09:59:14.441 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to INITIALIZING
2018-10-16 09:59:14.576 [me.event.ThingUpdatedEvent] - Thing ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ has been updated.
==> /var/log/openhab2/openhab.log <==
2018-10-16 09:59:15.087 [INFO ] [ertaintv.internal.EntertainTVControl] - EntertainTVControl: Send Pairing Request (firendlyName=‘PAD:OPENHAB_OH2’, deviceID=‘26A5F0FD7A02C93E07CFC428C499D182’, userID=‘’)
==> /var/log/openhab2/events.log <==
2018-10-16 09:59:15.252 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ changed from INITIALIZING to ONLINE
2018-10-16 09:59:15.275 [me.event.ThingUpdatedEvent] - Thing ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ has been updated.
==> /var/log/openhab2/openhab.log <==
2018-10-16 09:59:16.816 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: entertaintv:playStatus

The thing was successfully go online, but the control did not work (UserID was not yet entered), it`s okay on this time.

Now the MR400

Add the thing of the MR400 (not yet saved), in the logfile it appeared:

==> /var/log/openhab2/events.log <==
2018-10-16 10:11:02.628 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘entertaintv:receiver:bb5e21ce-2222-11b2-f918-AC6FBB2F1EC4’ has been removed.
2018-10-16 10:11:02.640 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:bb5e21ce-2222-11b2-f918-AC6FBB2F1EC4’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_CONFIGURATION_PENDING)
==> /var/log/openhab2/openhab.log <==
2018-10-16 10:11:06.173 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: entertaintv:playStatus

The receiver model was not found automatically, the field remained empty. It was manually set to MR400.

After saving the thing:

==> /var/log/openhab2/events.log <==
2018-10-16 10:12:14.301 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:bb5e21ce-2222-11b2-f918-AC6FBB2F1EC4’ changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to UNINITIALIZED (HANDLER_MISSING_ERROR)
2018-10-16 10:12:14.311 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:bb5e21ce-2222-11b2-f918-AC6FBB2F1EC4’ changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to INITIALIZING
==> /var/log/openhab2/openhab.log <==
2018-10-16 10:12:14.362 [ERROR] [tertaintv.handler.EntertainTVHandler] - EntertainTV: Device initialisation failed: Unable to initialize thing: Error sending HTTP GET http:// 192.168.9.147:49153/xml/dial.xmlfailed: http:// 192.168.9.147:49153/xml/dial.xml
==> /var/log/openhab2/events.log <==
2018-10-16 10:12:14.384 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:bb5e21ce-2222-11b2-f918-AC6FBB2F1EC4’ changed from INITIALIZING to OFFLINE (COMMUNICATION_ERROR): Unable to initialize thing: Error sending HTTP GET http:// 192.168.9.147:49153/xml/dial.xmlfailed: http:// 192.168.9.147:49153/xml/dial.xml
2018-10-16 10:12:14.396 [me.event.ThingUpdatedEvent] - Thing ‘entertaintv:receiver:bb5e21ce-2222-11b2-f918-AC6FBB2F1EC4’ has been updated.
==> /var/log/openhab2/openhab.log <==
2018-10-16 10:12:16.690 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: entertaintv:playStatus

This was not successful, the thing remains in OFFLINE status (Error sending HTTP GET)

I will now continue with the MR401 and try to determine the top of my UserID with the script.

If I should test something with the MR400, let me know.
But I currently have only one OpenHAB 2.3 installation to test and no 2.4.

Hi, I’m running OH 2.3 as well - that’s not a problem.

2018-10-16 09:56:45.579 [ERROR] [very.EntertainTVDiscoveryParticipant] - EntertainTV: Unable to create thing: null

Is it possible that you had a previous version of the binding installed? I had this issue while upgrading and having an old discovered entry.

If there is any thing from a previous installation make sure to remove them using PaperUI.

and check that

userdata/jsondb/org.eclipse.smarthome.config.discovery.DiscoveryResult.json

has no entries for entertainrv. If there is one stop OH, manually edit the file and restart OH. If you run a manual discovery from the Paper UI Inbox check if the binding title is displayed like “Entertain TV Binding”, class entertaintv. If it shows only entertaintv (no binding title) I’m pretty sure you have some left overs from a previous installation.

If the problem persist open the OH console, set the binding to trace mode (“log:set TRACE org.openhab.binding”) and restart OH.

MR401: I see

2018-10-16 09:59:15.087 [INFO ] [ertaintv.internal.EntertainTVControl] - EntertainTVControl: Send Pairing Request (firendlyName=‘PAD:OPENHAB_OH2’, deviceID=‘26A5F0FD7A02C93E07CFC428C499D182’, userID=’’)

that the userID is still empty. You shouldn’t be able to save the config without filling this field?

MR401:

2018-10-16 10:11:06.173 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: entertaintv:playStatus

That’s really strange. Please make sure that you have a clean install. Remove all things in Paper UI, change to userdata/jsondb and run

grep entertaintv *.json

If there is any match stop OH, edit the file, remove the entry and restart OH (keep backup copies in a different folder).

— Lets focus on the MR401 first, because that’s what I’m having here.

Hi, I’m running OH 2.3 as well - that’s not a problem.

You mean I should use this version in my 2.3 OpenHAB installation?:
https://github.com/markus7017/org.openhab.binding.entertaintv/blob/master/target/org.openhab.binding.entertaintv-2.4.0-SNAPSHOT.jar

that the userID is still empty. You shouldn’t be able to save the config without filling this field?

Yes, I left UserID blank when testing.

I have now from a Wireshark dump my UserID and this entered in the thing. I can control MR401 remotely, but i do not receive any feedback from the MR.

But that is also the state that I have read here in the forum for the version I tested 2.3.

After your answer which binding jar version i should test now, I’ll continue.

yep

and only the latest version has the event interface

you could use @Mat_Ias script to capture the userID, no more a need for Wireshark :slight_smile:

I did that.

Then I deleted all items and things in the PaperUI from the Entertain Binding.

Then the bundle “EntertainTV Binding” via ssh console removed, .jar deleted, OpenHAB restarted. And now the 2.4-SNAPSHOT enabled.

The MR401 was found via autodiscover, I added the new thing and entering my UserID.

2018-10-17 00:42:38.315 [hingStatusInfoChangedEvent] - ‘entertaintv:receiver:c1026e4c-e7fd-5393-a2f3-AC6FBB5C6A01’ changed from INITIALIZING to ONLINE
2018-10-17 00:42:38.072 [INFO ] [ertaintv.internal.EntertainTVControl] - EntertainTVControl: Send Pairing Request (firendlyName=‘PAD:openHAB’, deviceID=‘$Hereis my orginal deviceID$’, userID=’
$Here is my original UserID$‘)
2018-10-17 00:42:38.288 [INFO ] [.internal.handler.EntertainTVHandler] - EntertainTV: Power ON
2018-10-17 00:42:38.310 [INFO ] [.internal.handler.EntertainTVHandler] - EntertainTV: Pairing complete for ‘Telekom Wohnzimmer’ (UDN ‘C1026E4C-E7FD-5393-A2F3-AC6FBB5C6A01’, terminalID ‘26A5F0FD7A02
C93E07CFC428C499D182’, pairingCode=’$HERE IS MY ORIGINAL PAIRINGCODE$‘, verificationCode=‘F5600B299780840622C3B2C7FE83DA03’, userID=’$Here is my original UserID$')

So far, it looks good and the problem “Cannot find channel type: entertaintv:playStatus” is fixed.

Then I create the items again.
These do not work when operated. The new Channels “Description”, “Duration” and any more gets no values.

Now I’ve done a reboot of OpenHAB.
And now it works with the MR401.

I can control and get values ​​to the current sender and co.

Currently there is no update if you now switch on the real remote and when you turn off the MR.

Hi,
I think I’m standing on the hose. At which point do I have to enter my user and password.

Thank you

Hello Sebastian,

in this Post are linked a bash script:

And in this post is described how to use it:

Or you can use Wireshark to find your MD5 UserID.
At this time you can not get the UserID in the binding, by entering user / password.