Use constrain_input_boolean in listen_state?

I have following AppDaemon apps and each is triggered by constraint_boolean.

After HA and AD restarted if someone by mistake turns off any of these apps and later turn them back again then that app won’t work till I manually stop/start AD.

Apps.yaml:

  #this gets called only when this input_boolean is turned ON from the HA user interface
  constrain_input_boolean: input_boolean.dark_house_lights

Inside app:

Would it work if I add listen_state method on that same input_boolean and trigger the app to re-initialize again? If not can anyone suggests a better idea.

self.listen_state(self.change_trigger_status, "input_boolean.dark_house_lights")

Thank you

That’s not how it is supposed to work - callbacks should resume when the input_boolean is turned back on.

Can you post your code please?

My apologies. It was one of the automation with constraints scheduled to run only a few days a week. All is well :grinning:

1 Like