-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using "on_time" from lamdba #1004
Comments
Same Issue. I would like to define a variable in Home Assistant, and then assign that variable to on_time parameters. That way you can define the schedule without compiling the microprocessor every time. At the moment on_time does not accept lambdas |
For an alarm clock project example, this may be interesting: https://github.com/mmakaay/esphome-alarm-clock |
Dynamic would be a bad idea, since the code would have to execute the lambda function to see if anything changed. This is a waste of CPU time. |
@mmakaay, did you look into that in the meantime? Would be a great feature to have.
I think #2100 is requesting the exact same thing. In that thread, there was a proposal to link the cron config to an entity instead of a lambda. Could be number entities for hour/minute/second, or better the new time entity when #2267 is implemented. I'm not familiar with ESPhome internals, but maybe that allows to update the schedule based on that entity - whenever the entity state changes? |
Describe the problem you have/What new integration you would like
it would be useful to have the ability to dynamically define the on_time function
Please describe your use case for this integration and alternatives you've tried:
For example, if you want to insert alarms at specific times of the day (which can change over time), such as an alarm clock
Additional context
The text was updated successfully, but these errors were encountered: