ADR-0056: Several remotes in the remote popup — one page per remote chosen in the blueprint, keys translated by Home Assistant¶
Page en anglais
Cette page n'existe qu'en anglais.
Status: Accepted (2026-10-10, asked for by the author; not tried on a tablet when written). Date: 2026-10-10
Context¶
The remote popup drove one remote: the TV's (tv_telecommande input of the « Tab5 — emplacements » blueprint), with Samsung key codes (KEY_UP, KEY_ENTER…). The author has three: the Samsung TV (samsungtv integration), an Apple TV and a Freebox Player — both seen by Home Assistant through the Apple TV integration (pyatv). He wants them all in the same popup, a nicer layout, and touch targets at least as large as before.
Constraints: push-only and events-only (ADR-0001, ADR-0025) — the firmware names no entity and calls no action; the shared modal chrome (ADR-0009); one swipe mechanism for popups with pages (ADR-0046); colours from the palette (ADR-0029); instant transitions; a user who only filled tv_telecommande must see no change.
Verified on 2026-10-10 in homeassistant/components/apple_tv/remote.py (dev branch): send_command resolves any name with getattr on pyatv's RemoteControl (up, down, left, right, select, menu, top_menu, home, play, pause, play_pause, stop, next, previous, skip_forward, skip_backward…), except turn_on / turn_off (power) and volume_up / volume_down; there is no mute and no input source; remote.turn_on / turn_off only connect or disconnect Home Assistant. samsungtv passes the KEY_* codes through.
Decision¶
- Chosen in Home Assistant. A new blueprint input, « Autres télécommandes · Other remotes » (
telecommandes_autres, severalremoteentities, default empty). The list istv_telecommandethen the others, without duplicates, four at most; the rank is the page and the event slot:tv(the first, the slot a firmware before this ADR sends),tv1,tv2,tv3. An entity Home Assistant no longer knows keeps its place (pages do not move when a box sleeps) and is pushed without a name. The setup assistant (ADR-0053) proposes the other remotes when it found the TV's own and there are three others at most. - Pushed with every state. A key of
tab5_maj_emplacements, likegestesorgauche:telecommandes|layout|name|layout|name…;— layoutboitierfor an entity of the Apple TV integration (integration_entities('apple_tv')),tvotherwise; name = the device's (as named by the user), without its area and without a final parenthesis (« Salon · Freebox Player (Apple TV 3) » → « Freebox Player »),|and;replaced. Pushed even empty (telecommandes|;clears the pages). Read in pure C++ bytelecommandes_lire()(Tab5/socle/tab5_parse.*, section 13; cases intools/test_parse.cpp, fuzzed bytools/fuzz/fuzz_parse.cpp): complete pairs only, four at most, an unknown layout istv. Nothing in NVS: until Home Assistant pushes, the single page of before. - One page per remote.
tab5_telecommande.cpp(Tab5/paquets/tab5-telecommande.yamlhands it the widgets): the remotes' names at the top, right-aligned against the ×, and the left / right swipe —PagesPopup+pages_brancher()+pages_onglets(), never a second gesture handler. One remote, or none pushed: no names, no swipe. The title loses « TV » when names are shown. Changing page is instant: the same widgets are shown or hidden. - Two layouts, one popup. Body 1170 × 598 under the title: a main zone of 472 px and the bottom row (102 px).
- Main zone, left to right (290 + 24 + 400 + 24 + 258 + 24 + 150 = 1170): Power, Source (TV) or Stop (box), Menu — 290 × 128 each; the pad in a 400 px disc (arrows 150 × 110 pushed 20 px towards the rim, OK 160 px); Play, Pause, Back, Home — 258 × 100; volume 150 × 400 (+, Mute on a TV or the volume icon on a box, −). Every target is as large as before or larger.
- Bottom row: the TV's apps (Netflix, Prime, YouTube, CANAL+, PC) or the box's playback row (Previous, Rewind, Play / Pause, Forward, Next), 5 × 221.
- New template
tv_touche.yaml(icon + word, seven uses);tv_transport_btn.yamlnow makes the box's playback row. - Keys keep the Samsung vocabulary. Every key still sends
esphome.tab5_actionwithtouche/alimentation/appli; only the slot changes (telecommande_cle(): the page shown). The blueprint resolves the slot to its remote and, for a box, translates through one table (telecommande_apple_tv:KEY_ENTER→select,KEY_RETURN→menu,KEY_MENU→top_menu,KEY_REWIND→skip_backward…); a key without an equivalent (Mute, Source) sends nothing. Power: on a box, theturn_on/turn_offcommand according to its device'smedia_player(off, standby or unknown → on); on another remote,remote.toggle; slottvwith no remote, the TV'smedia_player.toggle, as before. Apps stay the Samsung TV's (script.tab5_tv_app, the TV of « Tab5 · TV Samsung »). - Screen TV available without the blueprint's TV. The navigation wheel, « Aller à l'écran » and the gestures offer the remote when the TV zone is present or Home Assistant pushed remotes (an Apple TV alone).
Consequences¶
- API contract unchanged (1.2.0): no action or field added,
tab5_maj_emplacementscarries one more key, which an older firmware ignores. Both orders work: a new firmware with an older blueprint shows the single page and sendstv; an older firmware with the new blueprint sendstv, the first remote, the TV's. - A
tvremote of another brand (Android TV, Harmony…) gets the SamsungKEY_*codes as before; a translation for it would be one more table and layout. - Six new screen texts in six languages; MDI glyphs
rewind(F045F),fast-forward(F0211),play-pause(F040E) andvolume-high(F057E) added tomdi_font_45. - Checked: blueprint templates rendered against the author's three devices with
ha_eval_template(read only),tests/test_telecommandes.py(codes, slots, translations, rendered payload and routing), the off-device render. Not checked: the keys on the real devices, the Freebox Player's power commands.