How accurate is sleep tracking? I had good sleep quality 8 hours still the app says poor quality.

My sleep was bad before yesterday night and before that night as well. Will that affect yesterday nights sleep. Any specific markers that suggest poor quality sleep.