@seidler first off, thanks for this post! I already started to implement the other alternative you linked and did not like it either. Your solution seems much nicer!
Sorry for bringing this up so late, but what exactly is the value_template calculation doing for us? I looked at my values, and it seems to me that the change_rate attribute already is bytes/s basically. Also when looking into the source, it seems to me that this is already what we want (see https://github.com/home-assistant/core/blob/6d24a65313f0c8413c71feeca79f2f0ff79d2b60/homeassistant/components/statistics/sensor.py#L270). Am I missing something here?
The conversion to Mbit/s makes sense, but the division by sampling_size - 1 I can’t follow right now.