How to get the Last successfully run?
Hi,
I am coding a parser to collect data directly from my weather station (GW1000 Ecowiit).
I need to reset a rain accumulator counter to zero at first execution of each day.
The idea is to compare the last successfully date and the current execution date to check if they are different. If yes, I set the counter to zero.
rmGetStartOfDay(current_execution_timestamp) != rmGetStartOfDay(last_successfully_run_timestamp)
Is there an easy and immediate way to get the last successful run date/timestamp? Parser settings? ParserConfig?
I have a few other options that I would like to avoid:
- Doing an API REST GET call to /api/4/parser (this requires authentication).
- Use params to store the last execution timestamp (user can change this or default this, and the calculation will be invalid).
Please, share your thoughts.
Regards,
Pedro
-
Best way is to use: https://rainmachine.docs.apiary.io/#reference/weather-services/parser/get
In the return code you have:
"lastRun": <timestamp>, "lastKnownError": "",
Please sign in to leave a comment.
Comments
2 comments