How Would I Create This Query?

I have a set of data which is basically a collection of sensors that take measurements throughout the day and saved to a Postgresql & InfluxDB database.

I’ve managed to set up a series chart which shows each senor on the x-axis and the y-axis shows the average number of measurements taken per day for the given time range e.g. Senors A takes on average 50 readings per day and Sensor B takes on average 30 readings per day over the last 3 months.

What I want to be able to do is look at the sensors as a group and ask how many readings a day does the average sensor take, I would want the option to exclude from the avearge days where a sensor takes no readings and optionally have a low pass filter to exclude outliers.

I’d love to know if there is a way this can be done!