If your router credentials changed then the thermostats will not have the correct login info to connect to it. There are multiple ways to fix this problem. The easiest way to fix it if you have many thermostats is to change the security type, SSID, and password of the new router to the same security type, SSID, and password as the old router. This will allow the thermostats to reconnect without having to adjust the settings.
Another way to get them on the network is to know what the new SSID and password will be ahead of time and go to the network settings page on the thermostat and change the settings before changing the router. This will allow the thermostats to automatically connect when the new router is installed.
The third way to put them on the new router network is to reset the thermostats and go from the ad hoc mode to the new network like you are setting up a new thermostat. If you choose to go this route you will need to reset your schedules afterward.
A fourth method would be to use WiFI Protected Setup (WPS) if your new router has that capability. You will need to place your router in WPS mode, go to a thermostat, remove the faceplate, and Press and release the SETUP button. This will put the thermostat into WPS mode and the router and thermostat will negotiate the security information, usually within about 60 seconds. Depending on the router, you may need to place the router into WPS mode again for each thermostat.