Hello,
is there any complete documentation somewhere to understand the syntax properly?
I made an automation which works but when I try to convert it into blueprint, it always fails and difficult to say why:
blueprint:
name: Light from Motion with retries
description: Turn a light on based on detected motion with retries
domain: automation
input:
motion_sensor:
name: Motion Sensor
description: PIR sensor that will be trigger the light.
selector:
entity:
target_light:
name: Lights
description: The lights to trigger.
selector:
entity:
by_motion:
name: by motion
description: input_boolean to tell that the light has been switched on by a motion sensor.
selector:
entity:
alias: Light from Motion
description: ""
triggers:
- type: occupied
entity_id: !input motion_sensor
domain: binary_sensor
trigger: entity
- type: not_occupied
entity_id: !input motion_sensor
domain: binary_sensor
trigger: entity
conditions: []
actions:
- choose:
- conditions:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.motion_detection
state: "on"
- type: is_occupied
condition: entity
#device_id: !input motion_sensor
entity_id: !input motion_sensor
domain: binary_sensor
- condition: state
entity_id: switch.inter_storeroom
state: "off"
sequence:
- action: retry.actions
metadata: {}
data:
sequence:
- type: turn_on
#device_id: !input target_light
entity_id: !input target_light
domain: switch
enabled: false
retries: 15
expected_state:
- "on"
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: !input by_motion
alias: Motion detection allowed, detection detected and light is off
- conditions:
- condition: and
conditions:
- type: is_not_occupied
condition: entity
entity_id: !input motion_sensor
domain: binary_sensor
- condition: state
entity_id: !input by_motion
state: "on"
enabled: true
sequence:
- action: retry.actions
metadata: {}
data:
sequence:
- type: turn_off
entity_id: !input target_light
domain: switch
enabled: false
retries: 20
expected_state:
- "off"
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: !input by_motion
alias: "Option2: Light trigger by motion and motion disappeared"
mode: single
I looked at [‘actions’][0], then [‘choose’][0], then [‘conditions’][0] & [‘conditions’][1] but it is still too difficult for me to figure out what is wrong
Thanks in advance for any support.