Hi all - I have a little question for you experts!
I have a few sensors spread around the house and have added PIRs to them all. I have added an automation that will alert me if any of them go off by sending a notification via Pushover to my phone but as the PIR does the on/off/on/off shuffle I get a lot of messages!
Is there a way of sending the initial “motion detected” message to MQTT and then ignore everything else for the next, say 3 minutes?
I did look at that but perhaps I understood it incorrectly. From my thinking, if the PIR sends MQTT messages saying on / off / on / off every (for an example) 10 seconds and I put a delay in for 1 minute, when that 1 minute has gone by Hass will grab the next MQTT messages and start sending messages again, although at a slightly delayed rate.
Perhaps I will go and re-read it - thanks for the reply!
If you have multiple PIR’s per room or area you could combine those to a group and trigger with the group state. Group evaluates to true if any of the entities are true and false when all entities are false.
Right off the top of my head one way you could do it would be to create an input_boolean and use it for a condition of your notification automation. then you could manipulate the boolean to get the result you want.
Example:
automation_1:
trigger:
platform: state
entity_id: binary_sensor.your_motion_sensor
to: 'on'
condition:
platform: state
entity_id: input_boolean.your_bool
state: 'off'
action:
- service: notification
.
.
- service: homeassistant.turn_on
entity_id: input_boolean.you_bool
automation_2:
trigger
platform: state
entity_id: input_boolean.your_bool
to: 'on'
action:
- delay: '00:03:00'
- service: homeassistant.turn_off
entity_id: input_boolean.your_bool
There may be a cleaner way but I think that should work.
working with an input_boolean is a good way.
there is also an input_datetime or a timer that can be used for simular ways to adchieve it.
i dont think it cant be done with less coding.
Use a value template to query the last time the pir was triggered and tell it to ignore it for x minutes. My snippit below is similar my pir will detect movement and switch a light on and then ignore any further movements for 120 seconds. Obviously you would remove the condition and substitute the service for ios push instead of light on… I’m sure you get the gist
Thanks to everyone who has taken time to reply - learning a lot so I guess an old dog can learn new tricks, it just takes a little more beating on the skull to get it to sink in!
Thanks again all