Restore device states on restart

It will be helpful if we can restore device’s old state when restarting the home-assistant app.

This is a duplicate: