Unfortunatelly the Telekom migrated our existing MagentaTV from the old M400/MR200 installation to the new MagentaTV One-Boxes. With the old MagentaTV binding i had everthing under control, the AndroidTV binding challanges me more.
Espacially the keycodes for programming a virtual remote in Openhab is a problem, i have read that @dk8pn have started some work on this, maybe he oder anyone else who have done this can share their code?
Played a bit arround with the element type “Buttongrid”. Major disadvantage is that it is stateless and that it can’t use dynamic icons. Thus, for the moment, i ended up with a mix of “Buttongrid” and “item state mapping” commands.
BasicUI screenshot of the openHAB remote control from my Windows 11 computer:
Edit: one remark w.r.t. “Forward” and “Rewind”. The original “Magenta One Remote” transmits continuous IR signals if these buttons are pressed. This allows to quickly move back and forth. The network remote control, as setup in openHAB, transmits a 10 secs forward or rewind step once if such button is pressed. Thus, it has to be pressed several times in order to “Forward” or “Rewind” quicker but it can’t replace the IR remote. This limitation could probably be improved by a rule which overtakes and improves this job.
Thank you very much for the inspiration, with that i build a basic remote for our two MagentaTV One.
I solved the EPG problem with a Functional Item (Switch) called FI_g01_studio_mtv_01_EPG, this triggers a little rule, which will hopefully work until the Telekom changes anything in the layout.
// EPG AKTIVIEREN UND DEAKTIVIEREN
rule "EPG"
when
Item FI_g01_studio_mtv_01_EPG changed
then
if (FI_g01_studio_mtv_01_EPG.state == ON) {
g01_studio_mtv_01_keycode.sendCommand(3) // HOME
Thread::sleep(1500)
g01_studio_mtv_01_keycode.sendCommand(20) // DOWN
Thread::sleep(1000)
g01_studio_mtv_01_keycode.sendCommand(66) // ENTER
}
if (FI_g01_studio_mtv_01_EPG.state == OFF) {
g01_studio_mtv_01_keycode.sendCommand(3) // HOME
Thread::sleep(1500)
g01_studio_mtv_01_keycode.sendCommand(22) // RIGHT
Thread::sleep(1000)
g01_studio_mtv_01_keycode.sendCommand(66) // ENTER
}
end
This have one constraint, if you hopp through the channels and leave by entering a program with OK, the EPG is ended, but the switch will stay ON, i did not found a solution for that since now. But the rule will go back to the selected channel even if you switch OFF, while you are watching TV within 2.5s. The long time between the commands is necessary to buffer a reaction time of the MagentaTV One. Maybe not the best solution, but it’s functional.
For the record problem i did not find anything since now.
For the switch, you could use “Metadata” → “Expiration Timer”. This makes your switch a push-button which will be OFF again after a configurable time.
For the REC button function you could also use a rule. Select a movie from EPG pressing “Enter”, step to “Record” and pressing “Enter” again (not yet the detailed procedure ).
rule "EPG MagentaTV Schlafzimmer"
when
Item MagentaTV_ONE_10763627BABA_Key_Press received command KEY_EPG
then
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(3) // HOME
Thread::sleep(1500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(20) // DOWN
Thread::sleep(1000)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(66) // ENTER
end
rule "EPG REC MagentaTV Schlafzimmer"
when
Item MagentaTV_ONE_10763627BABA_Key_Press received command KEY_EPGREC
then
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(66) // Enter
Thread::sleep(500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(22) // RIGHT
Thread::sleep(500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(66) // ENTER
Thread::sleep(500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(66) // ENTER
end
rule "TV REC MagentaTV Schlafzimmer"
when
Item MagentaTV_ONE_10763627BABA_Key_Press received command KEY_TVREC
then
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(66) // Enter
Thread::sleep(500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(19) // UP
Thread::sleep(500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(22) // RIGHT
Thread::sleep(500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(22) // RIGHT
Thread::sleep(500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(66) // ENTER
Thread::sleep(500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(66) // ENTER
end
I need no switch because i apply the buttongrid. The button codes KEY_EPG, KEY_TVREC and KEY_EPGREC are “freestyle” but this is sufficient in order to be recognized by the rules.
In order to record (REC), the steps are different for a REC in running live TV (KEY_TVREC) or a REC for a future element within the EPG (KEY_EPGREC).
Disadvantage to be handled with care: the buttons both also delete the programmed records again if pressed a 2nd time. The buttons TV_REC and EPG_REC could probably be separated more in order to prevent to be pressed by accident. Or the final “ENTER” could be taken out of the rule procedure in order to be pressed/confirmed manually?
Edit 27.08.2026:
For EPG recording, different programs unfortunately require different steps. Thus, this button doesn’t make much sense. For the button TV_REC i have not yet seen limitations.
Found a better solution for the RECORD issue. The Android Keycode 130 can be applied. This works from EPG as well as from live TV and all programs. The opened screen can be confirmed manually. Also integrated most functions into the buttongrid except the power ON/OFF switch due to the dynamic icon.
The keycode command can be applied directly from the buttongrid. Thus, finally we only need the rule for EPG.
rule "EPG MagentaTV Schlafzimmer"
when
Item MagentaTV_ONE_10763627BABA_Key_Press received command KEY_EPG
then
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(3) // HOME
Thread::sleep(1500)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(20) // DOWN
Thread::sleep(1000)
MagentaTV_ONE_10763627BABA_Keycode.sendCommand(66) // ENTER
end