Error in blueprint automation with input_boolean condition

Hello,

I’m trying to turn on a light when a motion is detected BUT only if the input_boolean “input_boolean.presence_invite” is false.

Home assistant throws this error :

Blueprint Motion-activated Light with condition generated invalid automation with inputs OrderedDict([(‘motion_entity’, ‘binary_sensor.sdb_ssol_detect_mouv_occupancy’), (‘light_target’, OrderedDict([(‘device_id’, ‘3fe73de2f010c03e05c2a0b7b55b3648’)])), (‘no_motion_wait’, 300), (‘boolean_condition’, OrderedDict([(‘entity_id’, ‘input_boolean.presence_invite’)])), (‘boolean_state’, False)]): Entity entity_id is neither a valid entity ID nor a valid UUID for dictionary value @ data[‘condition’][0][‘entity_id’]. Got None expected str for dictionary value @ data[‘condition’][0][‘state’]. Got None

Here is my blueprint :

blueprint:
  name: Motion-activated Light with condition
  description: Turn on a light when motion is detected with input_boolean condition
  domain: automation
  input:
    motion_entity:
      name: Motion Sensor
      selector:
        entity:
          domain: binary_sensor
          device_class: motion
    light_target:
      name: Light
      selector:
        target:
          entity:
            domain: light
    no_motion_wait:
      name: Wait time
      description: Time to leave the light on after last motion is detected.
      default: 120
      selector:
        number:
          min: 0
          max: 3600
          unit_of_measurement: seconds
    boolean_condition:
      name: Boolean condition
      description: Boolean condition
      selector:
        target:
          entity:
            domain: input_boolean
    boolean_state:
      name: Boolean state
      description: Has to be true or false ?
      selector:
        boolean:

# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent

trigger:
  platform: state
  entity_id: !input motion_entity
  from: "off"
  to: "on"

condition:
  - condition: state
    entity_id: !input boolean_condition
    state: !input boolean_state

action:
  - service: light.turn_on
    target: !input light_target
  - wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - delay: !input no_motion_wait
  - service: light.turn_off
    target: !input light_target

And here is my automation :

- id: '1641484472902'
  alias: Plafond salle de bain - mouvement
  description: Allume la lumière de la salle de bain quand un mouvement est détecté
  use_blueprint:
    path: FPR/motion_light_condition.yaml
    input:
      motion_entity: binary_sensor.sdb_ssol_detect_mouv_occupancy
      light_target:
        device_id: 3fe73de2f010c03e05c2a0b7b55b3648
      no_motion_wait: 300
      boolean_condition:
        entity_id: input_boolean.presence_invite
      boolean_state: false

Anybody could help me with this problem ?

Thank you in advance community :heart: !

Try

boolean_condition: input_boolean.presence_invite

It does not work, but I think the error is slightly different :

Blueprint Motion-activated Light with condition generated invalid automation with inputs OrderedDict([(‘motion_entity’, ‘binary_sensor.sdb_ssol_detect_mouv_occupancy’), (‘light_target’, OrderedDict([(‘device_id’, ‘3fe73de2f010c03e05c2a0b7b55b3648’)])), (‘no_motion_wait’, 300), (‘boolean_condition’, ‘input_boolean.presence_invite’), (‘boolean_state’, False)]): expected str for dictionary value @ data[‘condition’][0][‘state’]. Got None

Thank you for your help

Try boolean_state: "false"

1 Like

There is not more error in logs, but :

  • The automation is not editable from UI anymore
  • The light doesn’t turn on, even if input_boolean.presence_invite is false :sweat_smile:

I think I have a clue :smiley:

I will fix this

Edit: It works now ! Thank you for your help @koying !!

The fixed automation is :

- id: '1641484472902'
  alias: Plafond salle de bain - mouvement
  description: Allume la lumière de la salle de bain quand un mouvement est détecté
  use_blueprint:
    path: FPR/motion_light_condition.yaml
    input:
      motion_entity: binary_sensor.sdb_ssol_detect_mouv_occupancy
      light_target:
        device_id: 3fe73de2f010c03e05c2a0b7b55b3648
      no_motion_wait: 300
      boolean_condition: input_boolean.presence_invite
      boolean_state: "off"

Here is the fixed blueprint :

blueprint:
  name: Motion-activated Light with condition
  description: Turn on a light when motion is detected with input_boolean condition
  domain: automation
  input:
    motion_entity:
      name: Motion Sensor
      selector:
        entity:
          domain: binary_sensor
          device_class: motion
    light_target:
      name: Light
      selector:
        target:
          entity:
            domain: light
    no_motion_wait:
      name: Wait time
      description: Time to leave the light on after last motion is detected.
      default: 120
      selector:
        number:
          min: 0
          max: 3600
          unit_of_measurement: seconds
    boolean_condition:
      name: Boolean condition
      description: Boolean condition
      selector:
        target:
          entity:
            domain: input_boolean
    boolean_state:
      name: Boolean state
      description: Has to be true or false ?
      selector:
        boolean:

# If motion is detected within the delay,
# we restart the script.
mode: restart
max_exceeded: silent

trigger:
  platform: state
  entity_id: !input motion_entity
  from: "off"
  to: "on"

condition:
  - condition: state
    entity_id: !input boolean_condition
    state: !input boolean_state

action:
  - service: light.turn_on
    target: !input light_target
  - wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - delay: !input no_motion_wait
  - service: light.turn_off
    target: !input light_target