WOL Switch state not working

Hello,

I am having some problems reading out the value of a WOL-switch.

In the configuration yaml I made the code:

switch:
  - platform: wake_on_lan
    mac: "00:24:1D:13:E8:8A"
    name: DESKTOP
    host: 10.0.0.2
    turn_off:
        service: hassio.addon_stdin
        data:
            addon: core_rpc_shutdown
            input: DESKTOP

That works exacly as it should.
But I want the computer automaticly shutdown after a periode of 3 hours.

Therefore I made the automation:

alias: Desktop uitzetten na 3 uur
description: ""
trigger:
  - platform: state
    entity_id:
      - switch.desktop
    to: "on"
    for:
      hours: 3
      minutes: 0
      seconds: 0
condition: []
action:
  - type: turn_off
    device_id: d2e930cfd95af2bdac392edbd55134ad
    entity_id: switch.desktop
    domain: switch
mode: single

The action works fine, only the trigger does not work.
I tried all kinds of things. I do have now state is “on” as trigger, but the entity gives as value “aan” (I think because the system is ‘dutch’.) So set the triiger to “aan” also not works. Put the trugger on “true”: no result.
How can I trigger an automation base of this switch?