#Detection within a specified period of time

1 messages · Page 1 of 1 (latest)

spark bay
#

Hi everyone, I’m trying to set up an automated programme that will alert me when pir doesn’t detect a human body during a specific period of time (say between 10am and 12pm), but I’ll only be able to set it up for a specific point in time or for a specific period of time (say four hours) for now… any suggestions please?

#

I’d like it to alarm at a specific time period for not detecting motion, rather than a specific time or duration.

kind frigate
#

You can use a History Stats sensor to count the number of times the motion sensor was 'on' in the desired time frame. Then trigger an automation at the end of the time frame using the count from the History Stats sensor as a condition.

#
# Example configuration.yaml entry
sensor:
  - platform: history_stats
    name: Motion Detected 10-12
    entity_id: binary_sensor.motion_example
    state: "on"
    type: count
    start: "{{ today_at('10:00') }}"
    end: "{{ today_at('12:00') }}"
trigger:
  - platform: time
    at: 12:00
condition:
  - condition: numeric_state
    entity_id: sensor.motion_detected_10_12
    below: 1
action:
  - service: notify.example
    data:
      title: Alert
      message: No Movement Detected this Morning
spark bay
#

Thank you very much for your help, I'm guessing that if I need to get it to alarm if it doesn't detect any movement at 10-12am, it just needs to be set to BELOW 1, which means it hasn't been triggered, right?

#

condition: numeric_state
entity_id: sensor.motion_detected_10_12
below: 1

spark bay
#

It doesn't look like it's working.🙃