Calculate cost from smart plug entity

Hi, I`m using Tapo smart plugs and Id like to calculate the running cost. The plugs provide a monthly total of usage in kWh. amicharge_this_month_s_consumption
The electricity cost is fixed at 8.5p per kWh. How can I calculate a cost figure I can display with a gauge or send via a notification?. Im assuming I have to create some sort of entity and assign a value to it based on consumption x cost? Regards Pete

Use a template helper to multiply the energy value by the price.

{{ states('sensor.monthly_energy')|float(0) * 0.085 }}
1 Like

I would imagine for my application that {{ states(‘sensor.amicharge_this_month_s_consumption’)|float(0) * 0.085 }} would be correct. How would I use this to produce, in the first place a gauge figure please?

This will provide an entity which you can use in your gauge

1 Like

I have managed to create a helper, many thanks. The Class of template was confusing me.