One notification for action

Hi. I would like to ask for help. How do create only one notification without a repeat for this rule


czujnik otwarcia drzwi = door sensor
czujnik ruchu salon = motion sensor
:slight_smile:
Regards Darek

What do you mean "without repeat"? You don't have any repetitions in your rule. Are you looking to make it so you get an announcement once when either the door opens or motion is active but not both until both are "reset" to closed and inactive? You could do that by changing both triggers to "changed" instead of "open" and "active." Then, modify your actions to something like this:

IF (Door Sensor open OR motion active AND HSM status is armed away) THEN
  If (Private Boolean False) Exit Rule
  Set Private Boolean False
  Set Volume to 80 --> delayed 0:00:03 (cancelable)
  Speak "Alarm notification" --> delayed 0:00:05 (cancelable)
  Set Volume to 45 --> delayed 0:00:07 (cancelable)
 ELSE
  Cancel Delayed Actions
  Set Private Boolean True: This Rule
END-IF

I made a couple changes: first, I used Private Boolean to track whether this rule has already announced something. Second, I made your delays cancelable so that if it opens and closes quickly, you won't get a bunch of notifications in a row. Third, note how I modified the times on your delays. I think this is what you want--if you put a delay on an action, it immediately goes to the next action, then comes back and run the delayed action later. What you have written above could be correctly written like this instead:

Delay 0:00:03
Set volume to 80
Delay 0:00:02
Speak notification
Delay 0:00:02
Set volume to 45

(in other words, the behavior of standalone "Delay" actions is different in that execution does pause there). But what I did above will work in this case, too.

Also, if you're interested in capturing and restoring the volume of the Mini and not just setting it to 45 when you're done, this may help: Capturing custom attributes into variables

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.