Calculate Energy Consumtion & Costs

Not directly related but you might be interested to also read:

I agree with @binderth. In order to get the consumption of the device you need to calculate the integral product of power over time. With these sparse readings you are only able to get a rough number. If that’s okay with you you can simply define an item to store this number and a rule to add to it.

The better solution is often to get the consumption directly from the device. Most energy monitoring devices offer the additional data point.