#Detection within a specified period of time
1 messages · Page 1 of 1 (latest)
I’d like it to alarm at a specific time period for not detecting motion, rather than a specific time or duration.
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
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
It doesn't look like it's working.🙃