How to control a device that need to be updated over internet?
There are high chances you don't need to reflash remotely. Just write a generic control algorithm supporting all target sensors and actuators, and let the user download configuration parameters which could be stored in EEPROM. Then update those parameters remotely.

If you insist on remote reflashing, you should also design a bootloader which takes a hand if the last reflashing attempt was unsuccessful. Otherwise your system will be easy to "brick".