How can I obtain continuous results with a PostgreSQL query?
I don't think you need the subquery. Would this work?

SELECT sites.abbrev,
       measurements.ztime::date AS period_start,
       count(DISTINCT measurements.task) AS num_tasks,
       count(*) AS total_time
FROM sites
  JOIN tasks ON tasks.site = sites.id
  JOIN measurements
    ON (measurements.task = tasks.id
   AND measurements.ztime &gt;= '2016-10-10'
   AND measurements.ztime &lt; '2016-10-15')
WHERE sites.abbrev = 'AA-10'
GROUP BY sites.id,
         sites.abbrev,
         measurements.ztime::date
ORDER BY measurements.ztime::date ;