[SOLVED] Jython, timestamp of minimum value (minimumSince)

Hi,

with DSL i could get the timestamp of the minimum value (of a range) as follows

test.rules

timestampEpoch = (LaCrosseTemperatureSensor5_Temperatur.minimumSince(parse("2020-01-01")).timestamp.time as Number).longValue
MyDateTimeTypeFromEpoch = new DateTimeType(new DateTime(timestampEpoch).toString)
LaCrosseTemperatureSensor5_Temperatur_Min_ZP_2020.postUpdate(MyDateTimeTypeFromEpoch)

how can i do that with jython?
I can already determine the minimum value as follows

test.py

MinValueCurYear = PersistenceExtensions.minimumSince(ir.getItem("LaCrosseTemperatureSensor5_Temperatur"), DateTime(2020, 1, 1, 0, 0, 0, 0)).state

Thank you!

you tried with ...)).timestamp ?

Thank you, I have not considered the most obvious! :blush:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.