Error 77 is an error from Apple which means the iOS device isn't able to get the home information synced from the iCloud account. Typically the issue resolves itself after several hours. Please wait a few hours and then try again.
If the issue persists try the steps below:
•Check your Internet and Wi-Fi connections.
•Restart your iOS device and try again.
•Verify Keychain is enabled in Settings > iCloud.
•Verify Home is enabled in Settings > iCloud.
•If your iOS device is running iOS 10 and you have an Apple TV (4th Generation) or iPad setup as a Home Hub, please verify 2-factor authentication is enabled for the iCloud Apple ID.
•If the previous troubleshooting steps don't resolve the issue, Apple recommends going into the Apple Home App. You should see “Loading Accessories and Scenes”. After about 30 minutes the Apple Home app will pop up a message that says “This is taking awhile. Would you like to reset?" Continuing will reset the home information and allow you to setup your Thermostat.