Value Template with difference from two last values

Hello
Is there a way to simply get a value from the two lasts values of a sensor ?
It’s for get a bandwidth from a snmp value.
Otherwise I can use this python script https://github.com/clarkbox/checksnmptraffic/blob/master/checksnmptraffic.py but I prefer to use standard configuration if it’s possible

Thank you

You can differentiate the byte count to get a rate of change:

Great thank you I will try this