I’m hoping someone can help. I am trying to make an input_datetime entity, which should be the sum of another datetime entity + a sensor value. For example, I have input_datetime.cheapest_hours_car_charging which for argument sake gives a time of 02:00, and I have sensor.number_of_sequential_hours which lets say has a value of 2. I want to create a new input_datetime which gives the time 04:00.
I have tried using many of the existing posts in the template editor, but I keep getting errors.
How do I only output the time in only hours and minutes? Right now, the output is as follows:
“2024-05-27 03:00:00+02:00”
Just to add a bit more info (as it might help you to understand what I’m trying to do with it), I have created an input boolean called ‘Charge Car Now’, which is turned on in an automation when the cheapest hours have been identified by another sensor. When this is on (as well as another condition), the car will charge. The time at which the cheapest hours have been identified, has been determined by the number of sequential hours (a time window), which the cheapest hours sensor looks for in the electricity prices sensor I have. I want this Charge Car Now input boolean to turn off at a time corresponding to the cheapest hours + sequential hours (hence the two sensors I gave in the original post).
When I add in the template sensor you provided, I’m struggling to see how I use that in an automation… Basically, I want to turn off the input boolean at the time of the sensor you created for me