I have a few sensor.vision_zp3102_pir_motion_sensor_burglar and I was wanting to do some timing since last motion but couldn’t find what I was looking for. I was able to find logic for the last sensor that sensed motion but I need to know it’s been X minutes since last motion sensed for each device.
Thanks,
I have an entity which will show me the last PIR to change state, but really, it’s kind of useless, because what it would be REALLY useful is if it showed me instead the last PIR to report movement rather than simply “change”…
template_pir_motion:
friendly_name: 'Motion Location'
value_template: >
{%- set pirs = [states.binary_sensor.landing, states.binary_sensor.front_door_area, states.binary_sensor.kitchen, states.binary_sensor.attic] %}
{% for pir in pirs %}
{% if as_timestamp(pir.last_changed) == as_timestamp(pirs | map(attribute='last_changed') | max) %}
{{ pir.name }}
{% endif %}
{% endfor %}