How does grouping work? Does it work?

Try adding a WHERE time > now() - 5m or similar to limit the time range being queried.