Kodi->Receiver->TV - want to turn on TV-monitor through HA

I am struggling to have HA turn on my Philips TV (49PUS7809/12), which acts as a dumb monitor for my Kodi and Onkyo TX-NR535 Receiver. I have installed the JSON-CEC addon in Kodi and added the following to my media_player.kodi config:

turn_on_action:
service: media_player.kodi_call_method
data:
entity_id: media_player.kodi
method: Addons.ExecuteAddon
addonid: script.json-cec
params:
command: activate

However, I can’t get my TV to do any turn_on or turn_off action. I wonder if the fact that the HDMI signal passes through the receiver before going to the TV.

Does anybody have any idea on how to solve this delicate problem? Wake-on-LAN, media_player platform: universal or what have you? I just need the ‘friggin’ TV to turn on when I trigger an automation to watch TV or play media from Kodi.

It’s not the same context as your issue, but this could be useful:

Specifically creating a hass switch, and getting the switch to send the CEC commands, e.g:

  platform: command_line
  switches:
    tv_kodi:
      command_on: ssh root@[Kodi IP] "echo 'on 0' | cec-client -s"
      command_off: ssh root@[Kodi IP] "echo 'standby 0' | cec-client -s"
      friendly_name: TV

Thanks for the tip. However, my TV is not directly connected to Kodi. It is connected to my receiver, which passas Kodi through to my TV. I tried echo 'standby 0' | cec-client -s from the ubuntu command line, but got autodetect FAILED.

So, I guess I need to find a way to have my receiver pass the command on to the TV.