Change update interval from Number Components

I have made a unit using a ESP8266, and a CSE7766 voltage/current sensor. It works great but I would like to change update_interval with number components…

my code :

- platform: cse7766
    id: cse7766_sensor
    current:
      name: "T1 Current"
    voltage:
      name: "T1 Voltage"
      id: "T1_Voltage"
      accuracy_decimals: 1
    power:
      id: my_power
      name: "T1 Power"
    update_interval: never

number:
  - platform: template
    id : template_number
    name: "Template number"
    min_value: 1
    max_value: 600
    step: 1
    optimistic: true

time:
  - platform: sntp
    id: my_time    
    on_time:
      - seconds: !lambda |-
         return (id(template_number).state) ; 
        then: 
          - lambda: 'id(cse7766_sensor).update() ;'

This code throws an error:
:

     return (id(template_number).state) ;

esphome compiler show this error : this option is not templatable!.

Is there a way to fix this?

Welcome to the forum.

Please read this and then edit your post.

1 Like

thanks for reply.
i edited it

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

please help me for fix this problem.

It is not possible according to the error you are receiving:

no any idea?

It’s not about ideas. That option does not accept templates.

how do i schedule the updates?

I don’t think you can. Why do you want to?

Is it possible to use number as interval time?