Time Trigger Example - custom-components/pyscript GitHub Wiki
This is a simple example to fire a script every night at 5:15pm. This script simply puts a message in the log file to show that it has fired.
Time Trigger is useful for things you want to happen at a certain time every day. I have a few scripts using time trigger to handle adjusting the thermostat in the morning / night.
"""
Time test script
"""
@time_trigger("once(17:15:00)")
def time_trigger_test():
"""Trigger at 5:15pm every test example using pyscript."""
log.info(f"Time Trigger test:")