Probably want to use a groovy app for that. I was going to suggest another app that I use for temp, that could probably be modified fairly easy, but looks like someone already did something.
I have not tried this one but the explanation would do what you want.
Looks like that code is no longer available, try this one.
[UPDATED] - Average All (Temperature, Humidity, Illuminance, Ambient Pressure & Motion)