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?