I’m still working on my Sprinkler Reactor Sensor. My goal is to keep track of the last time the Reactor Sensor had the sprinkler relay run.
I am guessing my solution would be to log the current timestamp to an Expression Variable every time it runs the sprinkler? From there, I’m guessing this needs to be triggered any time the Condition goes true / the Activity runs.
ADDITIONAL DETAILS that hopefully make sense
I don’t think I should have it log timestamp every time the sprinkler device gets turned on, because maybe I flip that on manually and I wouldn’t want that to count as the sprinkler running.
I don’t think I can use the “Reactor Sensor Last Trip” because there are a couple conditions at play within there. Running the Sprinkler Relay is just one of the sub conditions.
Am I on the right track? Tried to do a little searching, found these two threads. But they seem to tackle grabbing that info from a device, rather than a condition within a Reactor Sensor.
No the %c signifies system time – a common Unix expression borrowed by the LuaXP language – which Reactor will evaluate as needed (kind of a “substitution within a substitution”).
But if you are not going to send yourself a notification, do you intend to go looking inside Reactor’s “Expressions” panel every time you want to know when a particular routine ran?
Maybe that’s the part we need to hash out a bit more here.
My goal is to be able to peek in there and reference last time it ran. Would also be nice to use that value in the Reactor Sensor by saying, for example, IF LastRuntime was 2 days ago or more AND forecast doesn’t call for rain tomorrow THEN run sprinkler in the morning. (This is a made-up example, but would generally like to use the Expression Value in that way)
I’m thinking I should do this?
CurrentTime := strftime(“%c”)
LastRunTime := (null)
And in the sprinkler Activity, Set Variable : LastRunTime = {CurrentTime}