If you want to schedule stuff to turn on or off at a specific time of the day, you will need to use automations.yaml.
Don’t forget to specify where the automations.yaml file is located in your configuration.yaml file.
The following code below is correctly-formatted, with the right amount of spaces in front of every line – which is very important.
So feel free to copy the text below, and change Alias, At, Entity and Service to better fit your needs.
automation: !include automations.yaml
- alias: "Name of this automation" trigger: platform: time at: '21:30:00' action: service: switch.turn_off entity_id: switch.light