I started home automation as a hobby in 2006 using Misterhouse. Less than two years later, I switched to Premise and, a decade later, continue to use it. Last summer I installed openHAB and Home Assistant to learn more about what these two leading open-source solutions have to offer.
Based on my experiences, the one sore-point in Home Assistant is precisely what you have identified, namely the absence of simple date-math functions. In all other systems I’ve used, there was a straightforward way to do date-arithmetic without resorting to awkward string-parsing techniques. Ideally, you want the ability to do basic things like subtract X hours from a given time, or X days from the current date, or other simple arithmetic operations for scheduling purposes.
I am not well-versed with Jinja2 but I believe it treats everything as a string and therefore the need to cast as int or float to ensure arithmetic operations are handled correctly. Ideally, there ought to be a way to cast as time so you could easily subtract two dates to get the number of intervening days. If not that then offering one or more functions, as you’ve suggested, to handle basic date and time arithmetic.