Automation changing entity value based on weekday and time

Hi all,

I currently have a number of smart plugs around the house, that measure consumption in kWh. I would like to use them to estimate the cost. The power provider in my country, however, has two prices based on time and date. Price 1 is for Mon - Fri, 7 am - 8 pm, and Price 2 is for all other times.

How can I create an entity that returns the necessary value depending on the time?

Thanks a lot in advance!

First you need to measure the energy used in each time period. This is easily done with Utility Meter Tariffs:

Then template helpers to multiply the energy sensors by the prices for each tariff.