Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105625

Comparing three timestamps and returning the lowest value

$
0
0

Forgive me if this has been asked and answered. This snippet is going into a custom dash card to report the last time a light switch was used.

{{ states.light.clinic_4_way_switch_light_1.last_changed | time_since, states.light.clinic_4_way_switch_light_2.last_changed | time_since, states.light.clinic_exam_1_light_switch_light_1.last_changed | time_since }} ago

This returns:

(‘4 hours’, ‘8 hours’, ‘36 minutes’) ago

…what I need is a method to compare all three timestamps and return the soonest, last used, timestamp. In the above example, I’d want it to only display:

36 minutes ago

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>