Kodi turn on\turn off actions dont work

So I have my Kodi media player added to my configuration.yaml file. The pause\play button works and it shows the current playing content but I can’t get the power button to do anything. Here’s my config.

media_player:
  - platform: kodi
    host: 192.168.0.101
    port: 6786
    name: LiquidIce-3
    turn_off_action:
      service: media_player.kodi_call_method
      data:
        entity_id: media_player.kodi
        method: Application.Quit

Same here, I can’t get it to work

I think your entity_id would need to be media_player.liquidice-3 or whatever your entities list shows it as.

I know it’s three years later, but I have managed to work by adding automations with Device Triggers after upgrading to 0.115.
Screen Shot 2020-09-20 at 21.19.08

Interestingly, however, turn_off_action works only when Kodi plays something. It didn’t work when Kose is in idle state.