I know this topic is quite old, still I will revive it as the problem sneaked its way all through to 2023 (2023.3.2 to be exact.) restore_mode: ALWAYS_ON doesn’t have any effect on Gosund SP112 plug’s main relay. It will always turn off after every restart or power outage. esp8266.restore_from_flash also shows no influence on the behavior. I expected this this to be irrelevant as we are not trying to restore the previous state but have the relay “always on”.
Best workaround I came up with as a workaround is a regular switch.turn_on though I am not too happy with that solution.
I ran into this issue as well. I had some a few recent power outages and turning all the Gosund plugs each time was a pain. Especially since some are hard to reach.
I use them as switches for lights and/or air purifiers, which are not always on but controlled through HA.
So the solution to check and turn them on every 10 second would not work well in these cases.
I did find an alternative that I wanted to share and that is use the on_boot command which is document on the link from above (ESPHome Core Configuration — ESPHome).
Once the plug receives power it waits until all the services are started and then switches the relay to on as well as the light: