Basic logic of transfering data.

How many thermostats are connected to each Uno?

If you only have one Uno why bother having the Mega as well.

If you need more pins why not use the Mega for that role?

...R