Add totals to webhook/mqtt

I am using the webhook addon to get my sleep events into Home Assistant. It would be nice if when I turn off tracking, it also fired totals to the webook and/or mqtt. Looking for total sleep time as a minimum, but breaking it down into total time in specific sleep stages, as well as apnea events, snoring, noise, etc would be nice.