Capture - Restore

I've moved away from SmartThings and imported my WebCore pistons. However, some of my capture and restore pistons are not working so I figured I'll give Rule Machine a try. I'm having trouble getting the syntax together.

What I'm trying to do is capture the state of various lights, turn them on at different levels and have them return to their previous state at different times. In WebCore, I was able to do asynchronous statements. I'm not sure how to do that in Rule Machine.

First off, consider relegating your outer IF conditions to the "Required Expression" section of your rule in RM. That way, it only fires during the specified timeframe while the (hub? should not be local) variable is False.

The innards look correct. That is, you only have a single CAPTURE / RESTORE buffer to work with in RM, so I presume you mean to handle each device separately as written, in series. (If you meant to Capture the two Lamp devices simultaneously, in parallel, then include them both in the initial Capture step, and remove the intermediate Cap/Res pair in the middle. Both would then be restored in the final step.)

1 Like

Thanks, I'll move the If statement to the "Required Expression"

Yes, I want both of the lamps captured at the same time, but I want them to be restored at different times. Would I be able to have different restores or just different delay times?

Sadly, I'm unable to locate any supporting documentation for the Capture - Restore feature in Rule Machine 5.1, so will for the time being refer you to some...


Reason: I don't want to mislead you by guessing the answer to your last question; I'm unsure whether Capture'd devices can be restored individually / asynchronously as described, but will endeavor to conduct testing along those lines.

Testing reveals the answer to be, "You can only Restore the last Capture'd set of Devices as a group." Subsequent Capture actions replace earlier ones, meaning Restore only deals with the latest device(s) Capture'd.

Thanks. I'll keep playing around with Rule Machine to see what works best.

1 Like

Since I can only have 1 capture per rule, I broke out each device into its own rule. Then from the main rule, I can just call each device rule so that each device can be restored without overwriting the other.

I also tried putting my If Statment in the "Required Expression" but when I choose variable, I get no options. I'm hoping it is just a bug and will be fix, or maybe I'll try another browser.


1 Like

Given that you are running both of your capture and restore sequences in unison, there is absolutely no reason you could not capture multiple devices in a single rule and restore those same devices all at once. It almost looks like that is what you are attempting to do and it would work; just choose all of the devices in the capture step.

I guess I could, but they will eventually be restored at different times. Even though they are captured at the same time, they are restored separately. This example was just to test and see what happens.

1 Like

Download the Hubitat app