Im sure Im missing something really stupid from documentation, I looked around also and I cant find a very simple way to subtract 2 input datetime helpers from each other to get how much time has passed between the 2.
The 2 datetime helpers are input_datetime.charging_started and input_datetime.charging_stopped… I`m just want to subtract and display in notification the difference between the 2 to get the duration.
However, most core Dashboard cards do not allow templating. If the card you want to use doesn’t allow templating, you will need to create a Template sensor and use that in your card.
This is super helpful - what would the syntax be if the helpers were just Time and not Date/Time. the ‘as_datetime’ did not work with just a time helper
If you know that they are always going to be the same calendar day, you can use the function today_at() to change the time string returned by a Time-only datetime helper into something more easily math-able:
If they aren’t necessarily going to be the same calendar day, it gets more complicated and you will need to provide more details about you use case so we can figure it out.
Thanks @Didgeridrew. The automation I am trying to create is for the daily charging of my solar batteries during the cheap rate period provided by my utility provider - so the day/date isn’t needed as the hours stay the same unless I swap tariff.