Skip to content

Constraint that starts and terminates the app itself, not just callbacks #2636

@dekiesel

Description

@dekiesel

Is there an existing feature request for this?

  • I have searched the existing issues

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions