Kodi Remote

You should be able to use the Kodi Call Method service to call any of the Kodi API commands.

Getting the format right can be tricky and I’m certainly no expert.

Search this topic for some examples. e.g. Billy’s post just a few above uses this:

  - type: button
    tap_action:
      action: call-service
      service: kodi.call_method
      service_data:
        entity_id: media_player.libreelec
        method: Player.SetSpeed
        playerid: 1
        speed: increment
      target: {}
    hold_action:
      action: call-service
      service: kodi.call_method
      service_data:
        entity_id: media_player.libreelec
        method: Player.SetSpeed
        playerid: 1
        speed: decrement
      target: {}

Thought I might share my own take on this :slight_smile:

  • The layout/icons closely resemble the native iOS / Chorus designs for consistency
  • I’m using Mini Media Player for the “Now playing” area
  • Just as @tom_l mentions- using the kodi.call_method service call, there’s no need for scripts to execute Kodi commands
  • Only two script are required, for the “Turn on/off” buttons
  • This setup requires one input_boolean.kodi_tv_state and two template sensors
  • To minimise Kodi API service calls, I’m using native media_player calls where possible

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - type: entity
        entity: sensor.kodi_tv_computed_state
        name: Kodi TV
      - type: conditional
        conditions:
          - entity: input_boolean.kodi_tv_state
            state: 'off'
        card:
          type: button
          tap_action:
            action: call-service
            service: script.kodi_power_on
            service_data: {}
            target: {}
          entity: input_boolean.kodi_tv_state
          icon: mdi:power
          name: Turn on
      - type: conditional
        conditions:
          - entity: input_boolean.kodi_tv_state
            state: 'on'
        card:
          type: button
          tap_action:
            action: call-service
            service: script.kodi_power_off
            service_data: {}
            target: {}
          entity: input_boolean.kodi_tv_state
          name: Turn off
          icon: mdi:power
  - type: horizontal-stack
    cards:
      - type: conditional
        conditions:
          - entity: sensor.kodi_tv_is_volume_muted
            state: 'false'
        card:
          type: button
          icon: mdi:volume-off
          tap_action:
            action: call-service
            service: media_player.volume_mute
            service_data:
              is_volume_muted: true
            target:
              entity_id: media_player.koditv
          hold_action:
            action: none
          show_name: false
      - type: conditional
        conditions:
          - entity: sensor.kodi_tv_is_volume_muted
            state: 'true'
        card:
          type: button
          icon: mdi:volume-high
          tap_action:
            action: call-service
            service: media_player.volume_mute
            service_data:
              is_volume_muted: false
            target:
              entity_id: media_player.koditv
          hold_action:
            action: none
          show_name: false
      - type: button
        icon: mdi:volume-minus
        tap_action:
          action: call-service
          service: media_player.volume_down
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
      - type: button
        icon: mdi:volume-plus
        tap_action:
          action: call-service
          service: media_player.volume_up
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
  - type: horizontal-stack
    cards:
      - type: button
        icon: mdi:subtitles-outline
        tap_action:
          action: call-service
          service: kodi.call_method
          service_data:
            method: Player.SetSubtitle
            playerid: 1
            subtitle: next
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
      - type: button
        icon: mdi:stop
        tap_action:
          action: call-service
          service: media_player.media_stop
          service_data: {}
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
        show_icon: true
      - type: button
        icon: mdi:play-pause
        tap_action:
          action: call-service
          service: media_player.media_play_pause
          service_data: {}
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
      - type: button
        icon: mdi:open-in-new
        tap_action:
          action: call-service
          service: kodi.call_method
          service_data:
            method: GUI.SetFullscreen
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
  - type: horizontal-stack
    cards:
      - type: button
        icon: mdi:skip-previous
        tap_action:
          action: call-service
          service: kodi.call_method
          target:
            entity_id: media_player.koditv
          service_data:
            method: Player.Seek
            playerid: 1
            value: bigbackward
        hold_action:
          action: none
        show_name: false
      - type: button
        icon: mdi:rewind
        tap_action:
          action: call-service
          service: kodi.call_method
          target:
            entity_id: media_player.koditv
          service_data:
            method: Player.Seek
            playerid: 1
            value: smallbackward
        hold_action:
          action: none
        show_name: false
      - type: button
        icon: mdi:fast-forward
        tap_action:
          action: call-service
          service: kodi.call_method
          target:
            entity_id: media_player.koditv
          service_data:
            method: Player.Seek
            playerid: 1
            value: smallforward
        hold_action:
          action: none
        show_name: false
      - type: button
        icon: mdi:skip-next
        tap_action:
          action: call-service
          service: kodi.call_method
          target:
            entity_id: media_player.koditv
          service_data:
            method: Player.Seek
            playerid: 1
            value: bigforward
        hold_action:
          action: none
        show_name: false
  - type: horizontal-stack
    cards:
      - type: button
        icon: mdi:home
        tap_action:
          action: call-service
          service: kodi.call_mathod
          target:
            entity_id: media_player.koditv
          service_data:
            method: Input.Home
        hold_action:
          action: none
        show_name: false
        icon_height: 40px
      - type: button
        icon: mdi:chevron-up
        tap_action:
          action: call-service
          service: kodi.call_method
          target:
            entity_id: media_player.koditv
          service_data:
            method: Input.Up
        hold_action:
          action: none
        show_name: false
      - type: button
        icon: mdi:information-outline
        tap_action:
          action: call-service
          service: kodi.call_method
          target:
            entity_id: media_player.koditv
          service_data:
            method: Input.Info
        hold_action:
          action: none
        show_name: false
        icon_height: 40px
  - type: horizontal-stack
    cards:
      - type: button
        icon: mdi:chevron-left
        tap_action:
          action: call-service
          service: kodi.call_method
          service_data:
            method: Input.Left
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
      - type: button
        icon: mdi:kodi
        tap_action:
          action: call-service
          service: kodi.call_method
          service_data:
            method: Input.Select
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
        icon_height: 50px
      - type: button
        icon: mdi:chevron-right
        tap_action:
          action: call-service
          service: kodi.call_method
          service_data:
            method: Input.Right
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
  - type: horizontal-stack
    cards:
      - type: button
        icon: mdi:subdirectory-arrow-left
        tap_action:
          action: call-service
          service: kodi.call_method
          service_data:
            method: Input.Back
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
        icon_height: 40px
        entity: media_player.koditv
      - type: button
        icon: mdi:chevron-down
        tap_action:
          action: call-service
          service: kodi.call_method
          service_data:
            method: Input.Down
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
        show_icon: true
        show_state: false
      - type: button
        icon: mdi:menu
        tap_action:
          action: call-service
          service: kodi.call_method
          service_data:
            method: Input.ContextMenu
          target:
            entity_id: media_player.koditv
        hold_action:
          action: none
        show_name: false
        icon_height: 40px
  - type: custom:mini-media-player
    entity: media_player.koditv
    volume_stateless: false
    hide:
      power: true
      controls: true
      volume: true
      icon: true
    artwork: full-cover
    name: Now Playing

/config/template_sensors.yaml

- name: Kodi TV computed state
  state: >
    {% if is_state('media_player.koditv', 'idle') and is_state('input_boolean.kodi_tv_state', 'off') %}
    Off
    {% else %}
    {{ states('media_player.koditv')|title }}
    {% endif %}
  icon: >
    {% if is_state('media_player.koditv', 'idle') and is_state('input_boolean.kodi_tv_state', 'off') %}
    mdi:television-off
    {% elif is_state('media_player.koditv', 'playing') %}
    mdi:television-play
    {% else %}
    mdi:television
    {% endif %}
- name: Kodi TV is volume muted
  state: >
    {% if is_state_attr('media_player.koditv', 'is_volume_muted', true) %}
    true
    {% else %}
    false
    {% endif %}

/config/scripts.yaml

kodi_power_on:
  alias: 'Kodi: Power on'
  sequence:
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.kodi_tv_state
  - service: kodi.call_method
    target:
      entity_id: media_player.koditv
    data:
      method: GUI.ActivateWindow
  - service: kodi.call_method
    target:
      entity_id: media_player.koditv
    data:
      method: Addons.ExecuteAddon
      addonid: script.json-cec
      params:
        command: activate
  mode: single
  icon: mdi:kodi
kodi_power_off:
  alias: 'Kodi: Power off'
  sequence:
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.kodi_tv_state
  - service: media_player.media_stop
    target:
      entity_id: media_player.koditv
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: kodi.call_method
    target:
      entity_id: media_player.koditv
    data:
      method: Addons.ExecuteAddon
      addonid: script.json-cec
      params:
        command: standby
  mode: single
  icon: mdi:kodi
2 Likes

I’ve done a little script to send keyboard input from HA to Kodi just like Kore Remote.

For anyone interested all you need is a input_text helper, use any card you like to edit it (I use custom:text-input-row), and launch this script with a button:

alias: KR_SEND_TEXT
sequence:
  - service: kodi.call_method
    data:
      method: Input.SendText
      text: |
        {{ states('input_text.kodi_buffer') }}    //The helper you choose
      done: true    //If true kodi will hit select after text input, otherwise it will just show the text on the 
                        keyboard
      entity_id: media_player.kodi   //Your kodi device
  - wait_template: ''
    timeout: '0:00:02'
    continue_on_timeout: true
  - service: input_text.set_value
    data:
      value: ''
    target:
      entity_id: input_text.kodi_buffer    //The helper you choose
mode: single
2 Likes

Awesome! Do you perhaps know what call method to use calling numeric digits… For changing channels? I have simple PVR Client and I can set everything up except the numeric numbers…

Hi guys,

My remote is working just fine, but I would really like to change my channels on a PVR addon…

So i.o.w if I press the channel numbers on my remote (physical mini keypad) for example 102 it works perfect… How can I simulate this via home assistant? Numbers 0-9… I 'think" it should be relatively simple…

Thanks guys

I think it would be a script like this (untested):

kodi_0:
  sequence:
  - service: kodi.call_method
    data:
      method: Input.Action
      action: "number0"

Likewise for:

"number1"
"number2"
"number3"
"number4"
"number5"
"number6"
"number7"
"number8"
"number9"

Hi Tom, thanks, yup tried exactly that… It says trigged if fired but not showing the digit been pressed as per mini keyboard… So not responsive as thought… It’s almost as if it’s only listening to “specific” methods" but it doesn’t make sense… scratching my head again because that seemed totally plausible…

What about this?

kodi_0:
  sequence:
  - service: kodi.call_method
    data:
      method: Input.ExecuteAction
      action: "number0"

It works Tom! Thanks buddy! :slight_smile:

1 Like

Hey, Tom thanks for this! Again it works!! The other thing I’m trying to do is creating an actual keyboard template with alphanumeric keys a-z… Do you perhaps know the method for calling this?

You’ll probably have to use Input.SendText as shown above, Kodi Remote - #85 by MaestroMetty

I have updated how my subtitle method works. From this:

lounge_kodi_input_next_subtitle:
  sequence:
    service: kodi.call_method
    data:
      entity_id: media_player.lounge_osmc_kodi
      method: Player.SetSubtitle
      playerid: 1
      subtitle: "next"
      enable: true

To this:

lounge_kodi_input_next_subtitle:
  sequence:
    service: kodi.call_method
    data:
      entity_id: media_player.lounge_osmc_kodi
      method: Input.ExecuteAction
      action: "nextsubtitle"

Hi, I’m sorry to bring this back after so long time. You did a got job summarizing previous comments in this thread. But I’d need further explanation on the “templating” part.
I created a file templates.yaml with @tom_I’s code, and added to the configuration.yaml with “template: !include templates.yaml” but it is not working. Can you explain a little bit more how you did it?
Thanks in advance.

Holy Necro, Batman! I have a hard time remembering what I did yesterday, let alone a year ago. :stuck_out_tongue_winking_eye: Reading my post that you quoted, I went to my media dashboard in Lovelace (I’m assuming I created a new dashboard that was initially blank.) Then I clicked the 3 dot menu, edit dashboard, then clicked the 3 dot menu again, raw configuration editor, then I pasted in the button templates from @tom_l. For convenience, here’s that section from my raw Lovelace configuration:

button_card_templates:
  icon_button:
    aspect_ratio: 4/3
    color_type: icon
    hold_action:
      action: none
    layout: vertical
    show_label: false
    show_name: false
    show_state: false
    styles:
      card:
        - border-radius: 10px
        - border: solid 1px var(--primary-color)
        - box-shadow: none
        - padding: 6px 6px
        - margin: 0px 0px
        - '--paper-card-background-color': rgba(0, 0, 0, 0)
      icon:
        - width: 28px
      name:
        - justify-self: middle
        - align-self: end
        - font-size: 14px
        - padding: 0px 0px
        - color: var(--secondary-text-color)
    tap_action:
      action: call-service
  menu_button:
    aspect_ratio: 4/3
    color_type: icon
    hold_action:
      action: none
    layout: vertical
    show_label: false
    show_name: true
    show_state: false
    styles:
      card:
        - border-radius: 10px
        - border: solid 1px var(--primary-color)
        - box-shadow: none
        - padding: 6px 6px
        - margin: 0px 0px
        - '--paper-card-background-color': rgba(0, 0, 0, 0)
      icon:
        - width: 28px
      name:
        - justify-self: middle
        - align-self: end
        - font-size: 14px
        - padding: 0px 0px
        - color: var(--secondary-text-color)
    tap_action:
      action: call-service

I did not create a templates.yaml, so I can’t help you there. I pasted my config directly into the raw editor of the Media dashboard. Hope this helps!

thanks for your quick answer, I’ll give it a try.

off-topic:
checking your name I assume you were born 92. Thats why you probably don’t know Japanese superRobot “Mazinger Z”. Give it try! :rofl:

I made it work with your comments. And learnt a starting point about button card !! what a profitable evening for me :rofl: :rofl:
Thanks so much.

I’m having difficulty trying to get this to work in node red sending it to Home Assistant. For instance, this works:

{
  "action": "pageup",
  "entity_id": "media_player.kodi_de1dd1bc895a38c",
  "method": "Input.ExecuteAction"
}

and it’s even simpler for just pressing the key up:

{"method":"Input.Up"}

EDIT: got smallforward working with:

{
    "playerid": 1,
    "value": {
        "step": "smallforward"
    },
    "method": "Player.Seek"
}

and including the entity_id doesn’t help either. https://kodi.wiki/view/JSON-RPC_API/v12#Player.Seek mentions a step parameter…

I’m doing this in node red so that based on the source input on my receiver, I can control Kodi, or Netflix et cetera with the same virtual remote.

I just use a helper/Boolean input and check what it is set to and route it to the correct remote, in this example: Kodi. Here’s the code:

[{"id":"36ee710550b80842","type":"api-current-state","z":"ed20569e.0fcf18","name":"","server":"ec455634.5638","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.preamp_kodi_source","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","x":790,"y":4340,"wires":[["74b2e29eb8998f86"],[]]},{"id":"ef06d2c7ab4bb047","type":"api-call-service","z":"ed20569e.0fcf18","name":"","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"media_player","service":"media_pause","entityId":"media_player.kodi_de1dd512f4f69f","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1530,"y":3940,"wires":[[]]},{"id":"5278f7c1901177a4","type":"api-call-service","z":"ed20569e.0fcf18","name":"Down","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.Down\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":4240,"wires":[[]]},{"id":"74b2e29eb8998f86","type":"switch","z":"ed20569e.0fcf18","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"play","vt":"str"},{"t":"eq","v":"pause","vt":"str"},{"t":"eq","v":"stop","vt":"str"},{"t":"eq","v":"left","vt":"str"},{"t":"eq","v":"right","vt":"str"},{"t":"eq","v":"up","vt":"str"},{"t":"eq","v":"down","vt":"str"},{"t":"eq","v":"select","vt":"str"},{"t":"eq","v":"back","vt":"str"},{"t":"eq","v":"rewind","vt":"str"},{"t":"eq","v":"fastforward","vt":"str"},{"t":"eq","v":"chup","vt":"str"},{"t":"eq","v":"chdn","vt":"str"},{"t":"eq","v":"home","vt":"str"},{"t":"eq","v":"info","vt":"str"},{"t":"eq","v":"ContextMenu","vt":"str"}],"checkall":"true","repair":false,"outputs":16,"x":1090,"y":4340,"wires":[["87d6e9ee7aea42cd"],["ef06d2c7ab4bb047"],["007f67d0ec07c03e"],["ac4d352e99f291cb"],["ae3754f5f82579c9"],["fe7e8d0612cb9c20"],["5278f7c1901177a4"],["5417f138cd7de57c"],["cc8949ebe30cf62a"],["40805776949d3fe7"],["c46c3a2f93a9534b"],["704c3ebe7afd8a39"],["8d61cecfe55f2e07"],["72efed837659fde3"],["5f9edc3f6c072d6d"],["bf569baa5c9334c1"]]},{"id":"fe7e8d0612cb9c20","type":"api-call-service","z":"ed20569e.0fcf18","name":"Up","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.Up\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":4180,"wires":[[]]},{"id":"ae3754f5f82579c9","type":"api-call-service","z":"ed20569e.0fcf18","name":"Right","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.Right\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":4120,"wires":[[]]},{"id":"ac4d352e99f291cb","type":"api-call-service","z":"ed20569e.0fcf18","name":"Left","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.Left\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":4060,"wires":[[]]},{"id":"5417f138cd7de57c","type":"api-call-service","z":"ed20569e.0fcf18","name":"Select","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.Select\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":4300,"wires":[[]]},{"id":"72efed837659fde3","type":"api-call-service","z":"ed20569e.0fcf18","name":"Home","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.Home\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":4660,"wires":[[]]},{"id":"cc8949ebe30cf62a","type":"api-call-service","z":"ed20569e.0fcf18","name":"Back","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.Back\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":4360,"wires":[[]]},{"id":"87d6e9ee7aea42cd","type":"api-call-service","z":"ed20569e.0fcf18","name":"","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"media_player","service":"media_play","entityId":"media_player.kodi_de1dd512f4f69f","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1530,"y":3880,"wires":[[]]},{"id":"007f67d0ec07c03e","type":"api-call-service","z":"ed20569e.0fcf18","name":"","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"media_player","service":"media_stop","entityId":"media_player.kodi_de1dd512f4f69f","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1530,"y":4000,"wires":[[]]},{"id":"208b80c401fb0c7a","type":"server-events","z":"ed20569e.0fcf18","name":"","server":"ec455634.5638","version":1,"event_type":"kodi_call_method_result","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":810,"y":4800,"wires":[[]]},{"id":"40805776949d3fe7","type":"api-call-service","z":"ed20569e.0fcf18","name":"  small backward","server":"ec455634.5638","version":3,"debugenabled":true,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"playerid\":1,\"value\":{\"step\":\"smallbackward\"},\"method\":\"Player.Seek\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1480,"y":4420,"wires":[[]]},{"id":"c46c3a2f93a9534b","type":"api-call-service","z":"ed20569e.0fcf18","name":"  small  forward","server":"ec455634.5638","version":3,"debugenabled":true,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"playerid\":1,\"value\":{\"step\":\"smallforward\"},\"method\":\"Player.Seek\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1470,"y":4480,"wires":[[]]},{"id":"8d61cecfe55f2e07","type":"api-call-service","z":"ed20569e.0fcf18","name":"Page Down","server":"ec455634.5638","version":3,"debugenabled":true,"service_domain":"kodi","service":"call_method","entityId":"","data":"{\"action\":\"pagedown\",\"method\":\"Input.ExecuteAction\",\"entity_id\":\"media_player.kodi_de1dd512f4f69f\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1470,"y":4600,"wires":[[]]},{"id":"704c3ebe7afd8a39","type":"api-call-service","z":"ed20569e.0fcf18","name":"Page Up","server":"ec455634.5638","version":3,"debugenabled":true,"service_domain":"kodi","service":"call_method","entityId":"","data":"{\"action\":\"pageup\",\"method\":\"Input.ExecuteAction\",\"entity_id\":\"media_player.kodi_de1dd512f4f69f\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1460,"y":4540,"wires":[[]]},{"id":"5f9edc3f6c072d6d","type":"api-call-service","z":"ed20569e.0fcf18","name":"Info","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.Info\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1450,"y":4720,"wires":[[]]},{"id":"bf569baa5c9334c1","type":"api-call-service","z":"ed20569e.0fcf18","name":"ContextMenu","server":"ec455634.5638","version":3,"debugenabled":false,"service_domain":"kodi","service":"call_method","entityId":"media_player.kodi_de1dd512f4f69f","data":"{\"method\":\"Input.ContextMenu\"}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1470,"y":4780,"wires":[[]]},{"id":"ec455634.5638","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

Small update to include some Kodi window navigation shortcuts thanks to stefanos. Details here: https://community.home-assistant.io/t/kodi-tv-series-button/399204/3?u=tom_l

Additional scripts (not all used in the card):

lounge_kodi_window_albums:
  sequence:
    service: kodi.call_method
    target:
      entity_id: media_player.lounge_osmc_kodi
    data:
      method: GUI.ActivateWindow
      window: music
      parameters:
        - Albums

lounge_kodi_window_artists:
  sequence:
    service: kodi.call_method
    target:
      entity_id: media_player.lounge_osmc_kodi
    data:
      method: GUI.ActivateWindow
      window: music
      parameters:
        - Artists

lounge_kodi_window_movies:
  sequence:
    service: kodi.call_method
    target:
      entity_id: media_player.lounge_osmc_kodi
    data:
      method: GUI.ActivateWindow
      window: videos
      parameters:
        - MovieTitles

lounge_kodi_window_recent_movies:
  sequence:
    service: kodi.call_method
    target:
      entity_id: media_player.lounge_osmc_kodi
    data:
      method: GUI.ActivateWindow
      window: videos
      parameters:
        - RecentlyAddedMovies

lounge_kodi_window_recent_tv_shows:
  sequence:
    service: kodi.call_method
    target:
      entity_id: media_player.lounge_osmc_kodi
    data:
      method: GUI.ActivateWindow
      window: videos
      parameters:
        - RecentlyAddedEpisodes

lounge_kodi_window_tv_shows:
  sequence:
    service: kodi.call_method
    target:
      entity_id: media_player.lounge_osmc_kodi
    data:
      method: GUI.ActivateWindow
      window: videos
      parameters:
        - TvshowTitles

New card layout:

entities:
  - card_type: horizontal-stack
    cards:
      - entity: script.lounge_kodi_input_home
        icon: mdi:home
        name: Home
        tap_action:
          service: script.lounge_kodi_input_home
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_window_recent_movies
        icon: mdi:movie-open-star
        name: New Movies
        tap_action:
          service: script.lounge_kodi_window_recent_movies
        template: menu_button
        type: custom:button-card
      - entity: script.lounge_kodi_window_recent_tv_shows
        icon: mdi:television-shimmer
        name: New TV
        tap_action:
          service: script.lounge_kodi_window_recent_tv_shows
        template: menu_button
        type: custom:button-card
      - entity: script.lounge_kodi_window_albums
        icon: mdi:music-box
        name: Albums
        tap_action:
          service: script.lounge_kodi_window_albums
        template: menu_button
        type: custom:button-card
    type: custom:hui-element
  - card_type: horizontal-stack
    cards:
      - entity: script.lounge_kodi_input_contectx_menu
        icon: mdi:menu
        name: Menu
        tap_action:
          service: script.lounge_kodi_input_contectx_menu
        template: menu_button
        type: custom:button-card
      - entity: script.lounge_kodi_input_info
        icon: mdi:information-outline
        name: Info
        tap_action:
          service: script.lounge_kodi_input_info
        template: menu_button
        type: custom:button-card
      - entity: script.lounge_kodi_input_up
        icon: mdi:arrow-up-bold
        name: Up
        styles:
          card:
            - background: var(--secondary-background-color-alpha)
        tap_action:
          service: script.lounge_kodi_input_up
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_window_artists
        icon: mdi:account-music
        name: Artists
        tap_action:
          service: script.lounge_kodi_window_artists
        template: menu_button
        type: custom:button-card
    type: custom:hui-element
  - card_type: horizontal-stack
    cards:
      - entity: script.lounge_kodi_player_play_pause
        icon: mdi:play-pause
        name: Play/Pause
        tap_action:
          service: script.lounge_kodi_player_play_pause
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_input_left
        icon: mdi:arrow-left-bold
        name: Left
        styles:
          card:
            - background: var(--secondary-background-color-alpha)
        tap_action:
          service: script.lounge_kodi_input_left
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_input_select
        icon: mdi:check-circle-outline
        name: Ok
        tap_action:
          service: script.lounge_kodi_input_select
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_input_right
        icon: mdi:arrow-right-bold
        name: Right
        styles:
          card:
            - background: var(--secondary-background-color-alpha)
        tap_action:
          service: script.lounge_kodi_input_right
        template: icon_button
        type: custom:button-card
    type: custom:hui-element
  - card_type: horizontal-stack
    cards:
      - entity: script.lounge_kodi_player_stop
        icon: mdi:stop
        name: Stop
        tap_action:
          service: script.lounge_kodi_player_stop
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_input_back
        icon: mdi:backburger
        name: Return
        tap_action:
          service: script.lounge_kodi_input_back
        template: menu_button
        type: custom:button-card
      - entity: script.lounge_kodi_input_down
        icon: mdi:arrow-down-bold
        name: Down
        styles:
          card:
            - background: var(--secondary-background-color-alpha)
        tap_action:
          service: script.lounge_kodi_input_down
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_input_next_subtitle
        icon: mdi:comment-text-outline
        name: Subtitle
        tap_action:
          service: script.lounge_kodi_input_next_subtitle
        template: menu_button
        type: custom:button-card
    type: custom:hui-element
  - card_type: horizontal-stack
    cards:
      - entity: script.lounge_kodi_player_rewind
        icon: mdi:rewind
        name: Rewind
        tap_action:
          service: script.lounge_kodi_player_rewind
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_player_fast_fwd
        icon: mdi:fast-forward
        name: Forward
        tap_action:
          service: script.lounge_kodi_player_fast_fwd
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_player_skip_back
        icon: mdi:skip-previous
        name: Skip Back
        tap_action:
          service: script.lounge_kodi_player_skip_back
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_player_skip_fwd
        icon: mdi:skip-next
        name: Skip Fwd
        tap_action:
          service: script.lounge_kodi_player_skip_fwd
        template: icon_button
        type: custom:button-card
    type: custom:hui-element
  - card_type: horizontal-stack
    cards:
      - entity: script.lounge_kodi_player_skip_back_30
        icon: mdi:rewind-30
        name: Back 30s
        tap_action:
          service: script.lounge_kodi_player_skip_back_30
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_player_skip_back_10
        icon: mdi:rewind-10
        name: Back 10s
        tap_action:
          service: script.lounge_kodi_player_skip_back_10
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_player_skip_fwd_10
        icon: mdi:fast-forward-10
        name: Fwd 10s
        tap_action:
          service: script.lounge_kodi_player_skip_fwd_10
        template: icon_button
        type: custom:button-card
      - entity: script.lounge_kodi_player_skip_fwd_30
        icon: mdi:fast-forward-30
        name: Fwd 30s
        tap_action:
          service: script.lounge_kodi_player_skip_fwd_30
        template: icon_button
        type: custom:button-card
    type: custom:hui-element
  - artwork: full-cover
    entity: media_player.lounge_osmc_kodi
    group: true
    hide:
      artwork: false
      controls: true
      icon: false
      name: false
      power: true
      power_state: true
      source: false
      volume: true
    icon: mdi:kodi
    info: scroll
    type: custom:mini-media-player
show_header_toggle: false
title: Kodi Remote
type: entities
2 Likes

Good job… :+1:

1 Like