diff options
-rw-r--r-- | blueprints/automation/motion/motion_switch.yaml | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/blueprints/automation/motion/motion_switch.yaml b/blueprints/automation/motion/motion_switch.yaml index e28d6da..31ba62c 100644 --- a/blueprints/automation/motion/motion_switch.yaml +++ b/blueprints/automation/motion/motion_switch.yaml @@ -10,6 +10,15 @@ blueprint: domain: binary_sensor # device_class: motion + door_entity: + name: Door Contact + description: Additionally trigger if door opens while no motion detected + default: {} + selector: + entity: + domain: binary_sensor +# device_class: contact + illumination_test: name: Illumination Test description: Select how to check if existing illumination is sufficient @@ -101,6 +110,11 @@ trigger: from: "off" to: "on" - platform: state + id: "door" + entity_id: !input door_entity + from: "off" + to: "on" + - platform: state id: "turn_off" entity_id: !input motion_entity from: "on" @@ -111,8 +125,17 @@ trigger: action: - choose: - conditions: - - condition: trigger - id: "turn_on" + - condition: or + conditions: + - condition: trigger + id: "turn_on" + - condition: and + conditions: + - condition: trigger + id: "door" + - condition: state + entity_id: !input motion_entity + state: 'off' sequence: - choose: - conditions: |