litinoveweedle / SmartIR

⏻ Control Home Assistant climate, fan, media_player and light devices via IR/RF controllers (Broadlink, Xiaomi, MQTT, LOOKin, ESPHome, ZHA)
MIT License
97 stars 32 forks source link

There are no buttons "Next channel", "Previous channel" in the media player for TV #110

Closed f1x6r closed 4 weeks ago

f1x6r commented 2 months ago

Home Assistant version Core v2024.8.2 Operating System v13.0

SmartIR version v1.18.0

SmartIR configuration

climate:
  - platform: smartir
    name: Kabinet AC
    unique_id: kabinet_ac
    device_code: 3333
    controller_data:
      controller_type: ZHA
      zha_ieee: "90:39:5e:ff:fe:0b:eb:27"
      zha_endpoint_id: 1
      zha_cluster_id: 57348
      zha_cluster_type: "in"
      zha_command: 2
      zha_command_type: "server"
    temperature_sensor: sensor.kabinet_temperature
    humidity_sensor: sensor.kabinet_humidity

  - platform: smartir
    name: Gostinaya AC
    unique_id: gostinaya_ac
    device_code: 3333
    controller_data:
      controller_type: ZHA
      zha_ieee: "90:39:5e:ff:fe:0b:98:33"
      zha_endpoint_id: 1
      zha_cluster_id: 57348
      zha_cluster_type: "in"
      zha_command: 2
      zha_command_type: "server"
    temperature_sensor: sensor.gostinaya_temperature
    humidity_sensor: sensor.gostinaya_humidity

  - platform: smartir
    name: Spalnya AC
    unique_id: spalnya_ac
    device_code: 3333
    controller_data:
      controller_type: ZHA
      zha_ieee: "90:39:5e:ff:fe:08:51:6f"
      zha_endpoint_id: 1
      zha_cluster_id: 57348
      zha_cluster_type: "in"
      zha_command: 2
      zha_command_type: "server"
    temperature_sensor: sensor.spalnya_temperature
    humidity_sensor: sensor.spalnya_humidity

media_player:
  - platform: smartir
    name: TV
    unique_id: tv_gostinaya
    device_code: 2222
    controller_data:
      controller_type: ZHA
      zha_ieee: "90:39:5e:ff:fe:0b:98:33"
      zha_endpoint_id: 1
      zha_cluster_id: 57348
      zha_cluster_type: "in"
      zha_command: 2
      zha_command_type: "server"
    device_class: tv

  - platform: smartir
    name: Acustic
    unique_id: kabinet_acustic
    device_code: 1111
    controller_data:
      controller_type: ZHA
      zha_ieee: "90:39:5e:ff:fe:0b:eb:27"
      zha_endpoint_id: 1
      zha_cluster_id: 57348
      zha_cluster_type: "in"
      zha_command: 2
      zha_command_type: "server"
    device_class: receiver

Device configuration

{
  "manufacturer": "Panasonic",
  "supportedModels": ["TX-LR42D25"],
  "supportedController": "ZHA",
  "commandsEncoding": "Raw",
  "commands": {
    "off": "BpIN6AbFAZEgAQEsBYAHAMUgAeAbBYAvAcUBQAMBxQHgAwWAAYARAcUBgCcCkQHF4BIBgCOAB0ALwANAE0ABQA9AC0AH4AMDAJEgAUAPAf//QMcCkQHFIAFAD0AJQAMBxQHgGQXALwHFAeAVK8An4BMlwCNAB+ADA8AzQBMAkSABQAfgAwMDkQHFAUAPAf//QMcBxQHAD0AHAcUB4B0FQD8AkSABAMUgAeATBYAnAMUgAeADBeAFAcAjQAfgAwMAkSABAMUgAUATQAlAB+ADA0ABQA8B//9Ax0AhAZEBQA8AkSABAMUgAeAbBYAvAcUBQAMBxQHgEQVAJwTFAZEBxSAB4A8FASwFgBkBLAXgBQPAAUAXA8UBkQFAB+ADAwHFAYATAf//wMcDxQGRAUADAywFkQFAB+ATA8AjQAfgAwPAM0ATQAtAB+ADA8ATAf//wHUBkQFAH0AH4B8D4B8v4BsnwCNAB+ADA8CLQBNAC0AH4AMDwBMB///guscCBZEB",
    "on": "BpIN6AbFAZEgAQEsBYAHAMUgAeAbBYAvAcUBQAMBxQHgAwWAAYARAcUBgCcCkQHF4BIBgCOAB0ALwANAE0ABQA9AC0AH4AMDAJEgAUAPAf//QMcCkQHFIAFAD0AJQAMBxQHgGQXALwHFAeAVK8An4BMlwCNAB+ADA8AzQBMAkSABQAfgAwMDkQHFAUAPAf//QMcBxQHAD0AHAcUB4B0FQD8AkSABAMUgAeATBYAnAMUgAeADBeAFAcAjQAfgAwMAkSABAMUgAUATQAlAB+ADA0ABQA8B//9Ax0AhAZEBQA8AkSABAMUgAeAbBYAvAcUBQAMBxQHgEQVAJwTFAZEBxSAB4A8FASwFgBkBLAXgBQPAAUAXA8UBkQFAB+ADAwHFAYATAf//wMcDxQGRAUADAywFkQFAB+ATA8AjQAfgAwPAM0ATQAtAB+ADA8ATAf//wHUBkQFAH0AH4B8D4B8v4BsnwCNAB+ADA8CLQBNAC0AH4AMDwBMB///guscCBZEB",
    "previousChannel": "BbANtgazAUABAxsFswHgIwHgHy/gGydAI0ADQAHAB0ABwAtAB0ADQAHABwuzAbMBGwWzARsFswE=",
    "nextChannel": "Ba8NuQazAUABAxsFswHgIwHgHy/gJyfgAy/gCwvgBxMDGwWzAQ==",
    "volumeDown": "BbQNsgazAUABAxkFswHgIwHgHy/gGyfgCyPgAxPgAwvAAQsZBbMBswGzARkFswE=",
    "volumeUp": "Ba8NuQazAUABAxoFswHgIwHgHy/gHyfgBwHgFzcLGgXnAbMBswEaBbMB",
    "mute": "BbUNrAazAUABAxUFswHgIwHgHy/gKydAM0AD4AMB4AMPAhUF6CADCbMBswGzARUFswE=",
    "sources": {
      "TV": "BbUNrAazAUABAxgFswHgIwHgHy/AJ8AH4BsBQCtAA+ADAeADD0ALCxgFswGzAbMBGAWzAQ==",
      "AV": "BaoNtwazAUABAxkFswHgIwHgHy/gGyfAI8AH4AcBwBfAB+ADAQMZBbMB",
      "Channel 1": "BasNswazAUABAxoFswHgIwHgHy/gHyfgAwHgFzPgAx8DGgWzAQ==",
      "Channel 2": "BbcNsQazAUABBBsF3AGz4CIBAxsFswHgGwHgGyfgByPgIw8DGwWzAQ==",
      "Channel 3": "Ba8NuwazAUABAxoFswHgIwHgHy/gKyfgCzPgAxPgBAsCBbMB",
      "Channel 4": "BbUNrgazAUABAxoFswHgIwHgHy/gGydAI0ADwAHgAwtAAUAPBBoF5wGzoAEPGgWzAbMBswGzAbMBGgWzAQ==",
      "Channel 5": "Ba0NuQazAUABAxkFswHgIwHgHy/gHydAAcArwAfgBwHAF8AHB7MBswEZBbMB",
      "Channel 6": "BbANugazAUABAxoFswHgIwHgHy/gGyfAI+AHB8AB4AcXwA8HswGzARoFswE=",
      "Channel 7": "BbANuAayAUABAxsFsgHgIwHgHy8EGwXlAbLgGgEBGwWAA0ABQAvgBwFAE0ADQAHABweyAbIBGwWyAQ==",
      "Channel 8": "Ba8NuQazAUABAxkFswHgIwHgHy/gGydAI8ADQAFAC+ADAUAPwANAAUALC7MBswGzAbMBGQWzAQ==",
      "Channel 9": "BaYNuAazAUABAxkFswHgIwHgHy/gHyfAAUAvQAPgDwFAG0ADC7MBswGzAbMBGQWzAQ==",
      "Channel 0": "Ba0NsQa0AUABAxUFtAHgIwHgHy/gGyfgAyNAC0AD4AMB4AMPQAtAAwu0AbQBtAG0ARUFtAE="
    }
  }
}

Describe the bug The "nextChannel" and "previousChannel" channel selection buttons are not displayed in the media player. I'm not entirely sure if this is my configuration error or a bug in the plugin code. I think it would be cool to also add “Play/Pause” buttons, “Up”; “Down” and “Ok” buttons for integration with the built-in remote control in Apple smartphones. If there are no plans to add, can I do it myself? Tell me where to look, if you don’t mind.

Снимок экрана 2024-08-17 в 19 31 41

Expected behavior The presence of buttons when adding them to the configuration. For example, like here:

Снимок экрана 2024-08-17 в 19 50 00
litinoveweedle commented 2 months ago

Hello,

I am not using media_player class myself, so extending its functionality depends on the submitted PRs. Your contribution would be definitely welcome.

I would start playing with the Supported Features as documented here. Please note, that as with any SmartIR integration there is no feedback from the device, so all states can be only assumed states, which limit significantly what can be implemented.

The media_player.py is rather simpler and easy to understand, it is a good start for you HA programming journey. Good luck!

charliejgallo commented 1 month ago

also this looks solved in 1.19.0b1!!!

tvs and receivers show the next track and previous track buttons ( not if the media_player is set as speaker...)

tested with my tv and cable tv box and works!!

Screenshot 2024-09-27 at 7 11 20 PM Screenshot 2024-09-27 at 7 12 14 PM Screenshot 2024-09-27 at 8 51 01 PM
litinoveweedle commented 4 weeks ago

Hello, @f1x6r and @charliejgallo for reporting and testing. I am closing this issue now. In case of any problems please feel free to reopen it or create new one. And thank you once again. ;-)