Question on a rule

I'm working on configuring my smoke detected rule, however I'm a little unsure of how to go about repeating a single action and not the entire rule.

I'd like to add in an action to repeat speaking a message to an echo device every 15 seconds until smoke detection clears, but I don't want to repeat the entire rule. Should I do that in a seperate rule or can it be done added to my rule above?

Thank you,

First, you are going to want to change the trigger to "Changes" rather than turn on. Then you are going to want to add modify your actions as follows:

Actions:
If any detector is ON THEN:
     Turn on your lights
     Thermostat to off
     Turn off the fans
      Unlock the locks
      Notify via phone
      Repeat actions every 15 seconds pending cancellation
             Speak message on your speakers.
      END-REPEAT
ELSE
      Stop repeat actions
END-IF

If you want to get really fancy, you could also capture the current state of your lights before turning them on and then restore them in the Else part of the rule. I have almost the exact same rule in my system and I am also capturing the state of the HVAC system and restoring that as well after the alert is cleared.

I have a z-wave thermostat and would appreciate if you could share how you are capturing the state of your HVAC system and then restoring. I have a similar rule for when my smoke alarm goes off, I am able to capture and restore the lights, but could not figure out how to capture and restore the hvac. Thanks.

I'm using a "wait" in mine which is another possibility.

Thanks, I see what you did by creating a mode called HVAC mode and then simply restoring back to the mode when the alarm goes off. Do you put the above inside your rule with the other automations that happen on smoke (lights, locks, messages) or do you do seperate rules for each. If I put the above in my existing rule its gonna get pretty long. Any concerns with that.

Sorry, I am trying to recreate this and I am not sure what your HVAC Mode is? Is this some type of virtual device you created?

No, it's a local variable inside of Rule Machine. I have all the other alerts built into Hubitat Safety Monitor.

I can recreate your rule (or at least that start of it) by creating a virtual thermostat named "HVAC Mode" and then having having the rule act on it. But I am unable to find any other way to have RM set HVAC mode. I can select "Set Mode or Variables, Run Custom Action" but I see nothing in that to do what you have done. I wonder if it is because my thermostat is using "generic zwave thermostat"

I'm sorry but I don't have time at the moment to walk you through each and every step to implement the rule. I recommend that you play around in Rule Machine and look at some of the examples up on the docs.hubitat.com website. I guarantee you, all the options are in there and you don't need virtual devices to implement the rule as I have written it.

No problem, thanks for the help you gave. Any help is always appreciated. I managed to figure out that I needed to create a Global Variable Called "HVAC Mode" and then the rest of the work in Rule Machine was easy. I had never created a Global Variable before, so it is nice to learn something new. On a side note I did create the rule with a virtual thermostat that I named "HVAC Mode" and it worked exactly the same. Don't know if it matters, but I figure a rule containing a global variable as opposed to a virtual thermostat is probably easier for the hub to execute. Thanks for the Help.

Finally getting a chance to reply here... my smoke and Co2 detectors are Nest Protects. I have homebridge setup on my NAS and have virtual switches being used to inject the detectors into Hubitat...