Hi,
I would like to subtract two values. The first value should be the value of a sensor at 20:00 and the second one the value at 09:00.
The subtraction will be calculated at 20:00.
The automation is not the problem but I don’t know wich template I could use to get a value of the sensor at a precise date and time.
You will need an automation that triggers at 9:00 and stores the sensor’s state somewhere (like in an input_text). The automation that triggers at 20:00 will perform its calculation using the sensor’s current state and the one saved in the input_text.