I fixed all of my button issues by using webCore and disabling command optimization so that the on or off command gets sent each time. This way it doesn’t matter what ST thinks the switched item’s state is. Works perfectly every time now.
It’s not local, but I don’t find the lag too bad.