Can't turn on samsung crystal uhd tv

I’ve been trying to turn on my samsung tv from home assistant.
I can turn the TV on from the Smart Things app on my phone.

I created the following automation to send the WOL

  • id: ‘1787501960814’
    alias: crystal wake up
    description: ‘’
    triggers:
    • entity_id: media_player.samsung_crystal_uhd
      from: ‘off’
      to: ‘on’
      trigger: state
      actions:
    • data:
      mac: e8:aa:cb:a8:d5:3e
      broadcast_port: 9
      action: wake_on_lan.send_magic_packet

After creating the new automation I restarted HA then went to the samsung tv device and click the power button to turn the TV on. Nothing happens! My automation does not get called, according to the Automations page.

What am I doing wrong?

Was it already on? Was it unavailable?
media_player.samsung_crystal_uhd is the entity that needs to be turned on (from off) to make that automation work.
Are you sure turning the device on does that?

Also for us to help you better, the formatting of the YAML would be better if you used the </> button in the editor here to format YAML and code.

My understanding is that the automation would intercept the request to turn on the tv and send the magic packet first. I was following the wake on lan info from google.
The TV is off when I test the automation.

Thanks

I just discovered that my automation gets called when the TV is turned on from its remote.
I guess that means my understanding of the trigger is completely wrong. ???

Thanks again