Callback constraints not working with input_boolean?

I can’t seem to get the input_boolean to affect the motion sensors, that is, to not have them run when the input_boolean is set to off. Here’s what’s happening:

I’m using the example app for motion_lights as written here: https://github.com/home-assistant/appdaemon/blob/dev/conf/example_apps/motion_lights.py

In my app.yaml file, I’m using the following configuration:

basement_motion:
  module: motion_lights
  class: MotionLights
  sensor: binary_sensor.basement_motion_sensor
  entity_on: switch.basement
  entity_off: switch.basement
  delay: 60
  constrain_input_boolean: input.boolean.basement_sensor

The input boolean is as follows:

basement_sensor:
      name: Basement Sensor
      initial: on
      icon: mdi:track-light 

With it set to on, the motion sensor works as expected. However, when I turn it off, the motion sensor is still active and still turns the lights on. Am I missing something? I’m very new to AppDaemon, so I very well may be missing something.

I think you need input_boolean.basement_sensor, but I’m surprised what you have doesn’t throw up an error.

@gpbenton Meaning not use the “input_boolean.” part of “input_boolean.basement_sensor”?

I tried that too after seeing your comment and I’m still having the same issue. The input_boolean was turned off but the motion sensor still turned the light on. No errors coming up in the logs in Docker.

No, I mean use an _ in input_boolean rather than the . you had used in your yaml.

1 Like

Despite the lack of error in the logs, that appeared to be the issue. There’s something about someone else looking at your code that makes everything clearer. Much appreciated, @gpbenton!

1 Like