If there is a power failure, does the Meross smart home device retain the selected settings?

Yes. Meross smart home devices will retain their settings and will automatically connect once power is restored.