My utility meter reports in reports kWh. I would like to get my ~current usage in Watts. The math is:
(current_val_kWh - previous_val_kWh) / ((current_val_time_seconds - previous_val_time_seconds)*3600)
The previous_val is the last value that was not the current value.
Is there an easy way to do this using a template sensor or do I need to write a custom component?