Do Not Disturb time

Hi,
I have several automations, I would like to disable them after exact time, and enable them again after exact time.
Time when to disable and enable I set in Home Assistant (two input_datetime entities).
It’s like scheduled Do Not Disturb feature.
How I to implement it in AppDaemon app. Everyone can create a lot of ifs, so I want use elegant solution.

Take a look at constraints. One way to do this would be to have an input_boolean for “do not disturb time”. Then one app that turns on/off the input boolean when current time is in-/outside the do not disturb timeframe. And in your apps use a constraint with this input boolean, so that the app will only run if the input boolean is off.

Yeah, thanks a lot.
Instead of input_boolean, I created binary_sensor.not_dnd_time and use it in constraint, it works.
But it actually doesn’t work with optional parameter for inversion:

constrain_input_boolean: binary_sensor.not_dnd_time, off

Maybe it because I use sensor not input, anyway, just inverted my sensor, so no problem.