Create Sensor: Hour since timestamp

Copy-paste the following template into the Template Editor and confirm it reports the correct elapsed time.

{{ time_since(states('sensor.saros_10_letztes_reinigungsende') | as_datetime) }}

If it meets your needs, you can use it in a new Template Sensor.


From the documentation:

  • time_since(datetime, precision) converts a datetime object into its human-readable time string. The time string can be in seconds, minutes, hours, days, months, and years. precision takes an integer (full number) and indicates the number of units returned. The last unit is rounded. For example: precision = 1 could return “2 years” while precision = 2 could return “1 year 11 months”. This function can also be used as a filter. If the datetime is in the future, returns 0 seconds. A precision of 0 returns all available units, default is 1.