Please check the following:
Open the Settings app on your iPhone.
Go to "Privacy & Security" > "Motion & Fitness"
Is Fitness Tracking turned on? If not, turn on Fitness Tracking.
On the same screen make sure Pillow appears on the list and is turned on.