Right now, I do this, it’s not a very nice solution
next = datetime.datetime.now() + datetime.timedelta(seconds=rate);
while min < max:
if datetime.datetime.now() > next:
next = nextTime(rate)
min = min + increment
service_data = {'entity_id': entity_id, attribute: min}
hass.services.call(service, action, service_data)
Hrm I need values from HA to be passed into the crontab somehow. This script, in practice runs every five seconds for a minute, every day at a give, but different, time. It’s for an alarm clock.
Right now it’s from the home assistant control panel, but in the future I hope to get some phyiscal turning knob that feeds into HA.
An automation could work, if I run it every 5 seconds and if HA/python could some how store and update a value/timestamp somewhere that is accessible from python. Then, I could run a script every 5 seconds that checks against that timestamp and if conditions are right sends a message to HA.