Start timer when sensor 100%

Good morning guys.
This is my problem i have a sensor on my home assistant that will go from 100% to 0 as soon it reach the 100%.

What i want to do is turn off a plug 30 second after the sensor reach 100%. I achived to turn it off as soon as i get a 100% but if add the 30 second condition it won’t turn off.

There is a way to start a timer when the sensor reach 100?

trigger:
  - platform: state
    entity_id: sensor.some_sensor
    to: 100
action:
  - delay: 30
  - service: switch.turn_off
    entity_id: switch.some_switch

Thank you very much