Lambda delay restore after reboot

it’s possible save lambda delay after reboot or power off?

I try to add the parameter “restore_value” but doesn’t save anything after reboot or power off

  - platform: gpio
    id: relay1
    name: "Basculante"
    pin: P14
    icon: "mdi:garage"
    - delay: !lambda return (id(TDLB).state);
    - switch.turn_off: relay1
  - platform: template
    name: "TDL Basculante"
    id: TDLB
    optimistic: true
    min_value: 250
    max_value: 10000
    step: 250
    mode: slider
    restore_value: true

You can try with a global, use an on_value trigger under the number to mirror the number value and use the global in the lambda.

Edit you can set the logger to VERBOSE and you should see what is going on, my thought is that the number loads after.

For esp8266 platfoem check this setting:

  • restore_from_flash (Optional, boolean): Whether to store some persistent preferences in flash memory. Defaults to false.

IMHO it required ro save number value.

Thanks for trick