system.alarm.queryJournal

I just cant get the queryjournal script call to work properly. it fetches nothing. I think it requires some special formatting for start, end dates

startd = system.date.now()
endd = system.date.addDays(startd, -9)
results = system.alarm.queryJournal(journalName=“Journal”, startDate=startd, endDate=endd)

However if I just skip the startDate, endDate parameters it does fetch results for the last eight hours. My gateway is running on 8.1.7 if it matters

You have the end date before the start date. Swap those and it should work.

endDate = system.date.now()
startDate = system.date.addDays(endDate, -9)
results = system.alarm.queryJournal(journalName=“Journal”, startDate=startDate, endDate=endDate)
2 Likes

@schenk silly me, Thanks