Extant consumer devices for tracking sleep are largely restricted to providing information on sleep duration, whereas scientific evidence indicates that it is sleep quality that matters most for health and well-being. However, none of the currently available consumer-oriented sleep systems includes a validated method for assessing sleep quality. The objective of the present project was to integrate sleep quality assessment algorithms from various academic and commercial partners into a single automated and validated software tool. To this end, we successfully developed an automated approach for processing polysomnography data, from cleaning through feature extraction to assessing feature importance. The approach has been applied to three datasets thus far, comprising >9000 sleep recordings. In summary, we found that sleep quality can best be assessed by not only including conventional sleep architecture variables (e.g. sleep efficiency, wake after sleep onset) but also including metrics related to sleep microstructure (e.g. duration of K-complexes, fast sleep spindle amplitude) that have previously gone unnoticed. An optimal set of features has been defined and can be refined based on ongoing additional validation in datasets that are currenty available or will become available. Scripts for automated data preprocessing and feature calculation have been completed to integrate in products that can thus provide evidence-based feedback on sleep quality.