Is there an existing feature request for this?
Your feature request
It'd be great if there was a set of app level constraints, analogous to constrain_start_time and constrain_end_time that completely initialized and terminated a whole app.
constrain_start_time and constrain_end_time only stop callbacks, but if you for example want to run a callback once per day and only when certain conditions are met and if the current time is between X and Y then it quickly becomes a lot of code.
It'd be much easier if there was an option to initialize and terminate an app using something like constrain_app_start_time and constrain_app_end_time.
Example:
I want to listen for a state change, but only react to that state change once per day. If the app is initialized while the entity is in that state I want to run the automation.
At the moment I need to have a listen_state for the (let's say input_boolean) and midnight so that I can have a boolean that tells me whether this entity already has been changed today. But the midnight callback can only happen at midnight if midnight is between X and Y when using constrain_start_time and constrain_end_time
Is there an existing feature request for this?
Your feature request
It'd be great if there was a set of app level constraints, analogous to
constrain_start_timeandconstrain_end_timethat completely initialized and terminated a whole app.constrain_start_timeandconstrain_end_timeonly stop callbacks, but if you for example want to run a callback once per day and only when certain conditions are met and if the current time is between X and Y then it quickly becomes a lot of code.It'd be much easier if there was an option to initialize and terminate an app using something like
constrain_app_start_timeandconstrain_app_end_time.Example:
I want to listen for a state change, but only react to that state change once per day. If the app is initialized while the entity is in that state I want to run the automation.
At the moment I need to have a listen_state for the (let's say input_boolean) and
midnightso that I can have a boolean that tells me whether this entity already has been changed today. But themidnightcallback can only happen at midnight if midnight is between X and Y when usingconstrain_start_timeandconstrain_end_time