Hey there,
I’m trying to create a notification stating the timestamp when a certain max value is reached.
Attribnute looks like this:
state_class: measurement
data:
- datetime: '2024-08-21T19:00:00.000Z'
value: 24.1
This is what I’ve managed, so far:
{{ as_timestamp(strptime(state_attr('sensor.gust','data')[:12] |
map(attribute='datetime') | list | max, '%Y-%m-%dT%H:%M:%S.000Z')) | timestamp_custom("%H:%M Uhr") }}
That way I always get the latest timestamp. Is there a way to map the value attribute and return the corresponding timestamp instead?
Thanks a lot!