Im having a problem to turn on my Samsung Smart TV

I achieved this with the automation below:

  1. Wakeonlan enabled on Home Assistant.
  2. Remote control with mobile and remote control by IP on Samsung TV

This automation:

alias: "Power On TV da Suite"
description: Power On TV da Suite WakeOnLan
triggers:
  - device_id: 7e6a827a900be947f14294921b5d0fa5
    domain: samsungtv
    type: samsungtv.turn_on
    trigger: device
conditions: []
actions:
  - action: wake_on_lan.send_magic_packet
    metadata: {}
    data:
      mac: MAC_ADDRESS
      broadcast_port: 9
      broadcast_address: FIXED_IP_ADDRESS
  - action: media_player.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: media_player.suite_tv
  - action: media_player.turn_on
    metadata: {}
    data: {}
    target:
      device_id: 19c86b4b872eefeec0ce7fec0f3803e9
mode: single

The first media_player.turn_on is the device of the “Samsung Smart TV integration”, and the second one is the device from the “Samsung Smarthings integration”

@fabianosan I would like to try your solution, but I have some doubts.
I already get the broadcast and mac address and changed the entity_id. But your automation have 2 device_id. The first is the ID that you can get from the URL, right? And the second one?

The second is the TV device from Samsung SmartTV integration…

OK here is the issue that I have. I did the wakeonlan and everything described here.

The issue is that when I turn the TV off manually with the remote, screen goes blank, then 20 seconds later, I hear a click as if some relay had gone to the OFF state. Even after the click, I can still see the TV on my network with IP address and MAC address, so it must still be powered on.

However when I run the automation more than 20 seconds after turning the TV OFF, it fails at the " Media player: Turn on media player" stage with error SmartThingsCommandError (UnprocessableEntityError, response code is NOT_FOUND)

If I run the automation within 20 seconds after turning my TV off with the remote (before hearing the ckick), the automation works.

I tried to diasble all energy saving settings on my TV, and I could not find any setting that says “turn off something after 20 seconds”.

BTW my TV is the TQ75LS03BGUXXC.
I can control it OK from my phone with the Smartthings app.
Firmware is up to date.

How can I really turn the TV back ON with HA ?