With my Tasmota drivers state is kept correctly inside the device, so that is not a problem. The only requirement is that you need to use my modified version of Tasmota that pushes changes to HE. The release thread is here:
And documentation can be found here:
If one of your Sonoff devices isn't in the drop-down configuration menu in the driver, give me a shout and I'll add it.