Can't control Denon receiver using media_player.turn_on/turn_off

I have a Denon AVR-X2800H receiver, and the Denon integration installed (on HA 2023.2.2).
If I open the Denon integration in the HA GUI I can turn the receiver on/off using the power button, but I can’t turn it on or off by calling the media_player.turn_on/turn_off service (either manually from the HA GUI or in a script). Calling the service results in absolutely nothing happening.

  - service: media_player.turn_off
    data: {}
    target:
      entity_id: media_player.living_room

Any idea why this might be?denon avr

Some tips:

Latest firmware on your Denon?
Controlling via LAN enabled in the settings of the receiver?

Yes I have the latest firmware on the Denon.
I don’t see a option for controlling via LAN in the Denon settings. But I guess it must be enabled as I can control it from the Denon integration item in the HA Lovelace UI?

On your Denon:

Settings → network → there should be somewhere a setting, that allows or disallows remote control, when in standby modus. At least, my AVR-3600h has it, and it must be ALLWAYS ON.

Ah OK I found the “Network Control” option in the Denon Network Settings - it was already set to “Always on”

I’ve just noticed that I have a similar problem with my LG Smart TV (OLED65C24LA). I can’t turn it off using the media_player.turn_off command. If I try to configure it in the integrations area of the HA UI, I get: " Unable to retrieve the list of sources. Make sure device is switched on". The TV is turned on.

Not sure if it’s the same problem but it looks pretty similar
???

So, that looks like some network issue. Out of my scope, hope someone would jump in now :wink:

So I removed the LG integration and re-added it, then set up the TV again. It found the TV, but when I try to call the media_player.turn_on service I get: “…does not support this service”
???

As an alternative approach, I’ve tried this with the LG TV:

service: webostv.command
data:
  command: system/turnOff
  entity_id: media_player.lg_webos_smart_tv

This turns off the TV, but this does not turn it back on again:

service: webostv.command
data:
  command: system/turnOn
  entity_id: media_player.lg_webos_smart_tv

So then I installed the Wake-on-Lan integration and tried this:

service: wake_on_lan.send_magic_packet
data:
  mac: 20:28:bc:52:ae:e2
  broadcast_address: 192.168.255.255

But that wouldn’t work either (and I checked that the “Mobile TV On > Turn On Via WiFi” option was set on the TV).

I’m not sure if the Denon and LG issues have the same root cause. I rebooted my router/switch but it didn’t help.