Turn something on on a schedule?

Hello. Is there a way to turn something on at a certain time? Only local without relying on automation?

Thank you

Thanks @nickrout . In the event that you run out of internet, is it left with the last time that I synchronized? Can lambda buy a date time variable? I imagine that if so, do I have to separate hours and minutes or is there another easier way?

I am not sure, but there are four separate time sources available, HA, SNTP, GPS and DS1307. Only the first two need a network. Therefore if you contemplate being disconnected from wifi, use GPS or DS1307. DS1307 is less than $10.

I am not sure what exactly you mean by the second half of your question.

I’m going to start testing and if I can contribute something I’ll post it. Thanks a lot

Does anyone know why the variable “set_hour_on” does not appear in HA?

globals:
  - id: esp_hour_on
    type: int
    restore_value: no
    initial_value: '23'
    
number:
  - platform: template
    name: "variable hora encendido"
    id: set_hour_on
    optimistic: true
    min_value: 0
    max_value: 23
    step: 1
    on_value:
      - globals.set:
          id: esp_hour_on
          value: !lambda 'return id(set_hour_on).state;'

time:
  - platform: homeassistant
    timezone: "America/Argentina/Buenos_Aires"
    id: ha_time
    on_time_sync:
      then:
        - logger.log: "Synchronized system clock"    
    on_time:
      - hours: 20  
        then:
          - light.turn_off: led
          - lambda: |-
              ESP_LOGD("main", "Global value is: %d", id(esp_huor_on));
light:
  - platform: status_led
    name: "led"
    id: "led"
    pin: GPIO2

I think it will be called number.variable_hora_encendido

Actually, it will be seen as “number.esp_name_variable_hora_encendido” in HA