Thanks to a great suggestion here, my dumb door bell is now smart.
I created a simple rule to capture the state of lights in various rooms that I want to flash when the door bell is pressed then restore the lights to whatever state they were in before the doorbell rang.
This kinda works but sometimes it seems to leave lights in the opposite state from where they started, sometimes flashes once, sometimes twice, etc. I figured theres some wait or cycle delay missing somewhere... Would appreciate any tips.
What kind of lights do you have, and what driver ("Type" on the device page) are you using for them? Some natively support a "Flash" command (or can fake it in the driver), which would eliminate the work you're doing in this rule to simulate that behavior. I'm assuming you've already looked into that for your devices, but it's worth mentioning in case you haven't.
The only thing I can think of here is that you're capturing and restoring the group state. This will be one state for the entire collection of devices. It will not "remember"/capture individual different states within that group. Same with the restore. The workaround would be to use the individual devices for the capture and restore actions (you could still flash with the group; in fact, you might want to, especially if they are Zigbee devices and you can leverage group messaging).
If that's not it, then 2 seconds isn't super-fast but might be a bit to handle for some devices--Z-Wave in general tends to be a bit slow for me here but 2 seconds is probably enough (could try 2.5 or 3?). Zigbee devices should be able to handle this too, but if these are bulbs, those have always been quite picky on ZHA networks like Hubitat for me, and slowing things down can't hurt there, either. But again, I'd already consider 2 seconds enough, unless maybe you have a ton of devices in this group.
Do you need to capture the states? If you toggle them an even number of times they should end up in their original states.