Add calculated intermediate sensor values

My heat pump measures its total power usage in rounded kWh, and it sends a new value only once every 2 hours, and only when it changes. Can I make a statistics helper or template which calculates and adds more inbetween values, so the electricity dashboard can show a little better result than a big bar every 2 hours?