Resting heart rate is a health insight calculated from all the points during a day you are at rest including when you are in bed.
Two sensors are used to collect your heart rate data:
Wearable. This data is measured every minute and synced every 5 minutes. Note that if you are too far from your home-hub it will be synced only when you are close enough to it.
Sleep sensor. It detects subtle movements such as heart and breathing rates. This is why it needs to be placed on the mattress at chest height.