Measuring absolute number every X seconds and converting it to X/s value

Is this even possible in HA?
Ive got a SNMP sensor which measures how much overall data was sent through a network interface in bits and i want to convert this somehow to bits per second.
Obviously i need to refresh the SNMP sensor regularly once per second or per 5 seconds and somehow check the difference between current measurement and previous measurement.

A template sensor will accomplish this task. Be warned there is no way to make it (or anything in home assistant) update every x seconds. Things in home assistant only update when devices tell home assistant they update. So your template sensor will only update when the SNMP sensor updates.

I can always set up SNMP sensor to update every X seconds. The thing is that template sensor would need to know not only the current reading of SNMP sensor but also the previous one.

use the statistics sensor

set it to 6 seconds.

Look at the min and max in a different template.

1 Like