I was thinking something like relative_time would be useful for things like timers if it could use a future datetime.
It doesn’t look too hard to code, and I was thinking of submitting a PR
My question is, should I change the behavior of relative_time to allow future datetimes (I’m thinking probably not)?
Or should I create a relative_time_until which accepts only future datetimes?
Or perhaps just a relative_time_diff which doesn’t care?
For the first option, the reason I’m considering it is because is because I don’t know how often the return value is ever actually checked. And it is kind of a misleading function name (relative_age or relative_time_since would probably have been better choices).
Something alike already exists. When you have a sensor with a time in the state and device_class ‘timestamp’ it will show relative to the future as well.
I always wondered about the arbitrary requirement for past only and suspect if you create a PR for the existing relative_time filter to support future times it would be accepted and be a great addition.