#Detect Person Cleared for 30 Sec, Bring Lights Down

1 messages · Page 1 of 1 (latest)

carmine ingot
#

I've got an automation that not working right.

Here's what I have working.

When:
When my Reolink Doorbell person detection changed.

And If:
Between sunset and sunrise.

Choose:
Option 1:
Conditions:
Reolink Doorbell Person Sensor Detected.

Actions:
  1. Save a snapshot of the front door lights and the drive way lights (front_door_snapshot).
  2. Activate Front Door Person scene.

Option 2:
Conditions:
Reolink Doorbell Person Sensor Cleared.

Actions:
  Activate front_door_snapshot scene.

But I don't want option 2 to trigger as soon as the doorbell person sensor clears. I've set the option 2 trigger to "Reolink Doorbell Person Sensor Cleared for 30 sec" and it breaks the automation. I don't want a wait 30 sec in the actions because it triggers the snapshot scene before the person might be out of the view. Anybody have and idea?

rough finch
#

Please share the actual YAML

wintry wyvernBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

deft wasp
carmine ingot
# rough finch Please share the actual YAML

This works.

alias: Front Door Person
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.harrison_front_doorbell_person
conditions:
  - condition: sun
    before: sunrise
    after: sunset
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.harrison_front_doorbell_person
            state: "on"
        sequence:
          - action: scene.create
            metadata: {}
            data:
              scene_id: front_door_snapshot
              snapshot_entities:
                - light.front_door_lights
                - light.driveway
          - action: scene.turn_on
            metadata: {}
            data:
              transition: 2
            target:
              entity_id: scene.front_door_person
      - conditions:
          - condition: state
            state: "off"
            entity_id: binary_sensor.harrison_front_doorbell_person
        sequence:
          - action: scene.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: scene.front_door_snapshot
mode: single
carmine ingot
# rough finch Please share the actual YAML

This one doesn't.

alias: Front Door Person
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.harrison_front_doorbell_person
conditions:
  - condition: sun
    before: sunrise
    after: sunset
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.harrison_front_doorbell_person
            state: "on"
        sequence:
          - action: scene.create
            metadata: {}
            data:
              scene_id: front_door_snapshot
              snapshot_entities:
                - light.front_door_lights
                - light.driveway
          - action: scene.turn_on
            metadata: {}
            data:
              transition: 2
            target:
              entity_id: scene.front_door_person
      - conditions:
          - condition: state
            state: "off"
            entity_id: binary_sensor.harrison_front_doorbell_person
            for:
              hours: 0
              minutes: 0
              seconds: 30
        sequence:
          - action: scene.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: scene.front_door_snapshot
mode: single
deft wasp
# carmine ingot This works. ``` alias: Front Door Person description: "" triggers: - trigger:...

something like this is what I was suggesting

alias: Front Door Person
description: ""
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.harrison_front_doorbell_person
    to: "on"
    id: detected
  - trigger: state
    entity_id:
      - binary_sensor.harrison_front_doorbell_person
    to: "off"
    id: cleared-for-30s
    for:
      hours: 0
      minutes: 0
      seconds: 30
conditions:
  - condition: sun
    before: sunrise
    after: sunset
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - detected
        sequence:
          - action: scene.create
            metadata: {}
            data:
              scene_id: front_door_snapshot
              snapshot_entities:
                - light.front_door_lights
                - light.driveway
          - action: scene.turn_on
            metadata: {}
            data:
              transition: 2
            target:
              entity_id: scene.front_door_person
      - conditions:
          - condition: trigger
            id:
              - cleared-for-30s
        sequence:
          - action: scene.turn_on
            metadata: {}
            data: {}
            target:
              entity_id: scene.front_door_snapshot
mode: single
carmine ingot