Detecting recovery piston execution


#1

I’m having a piston that toggles the switch and updates tile state in top-level “main loop”. Then it has couple of triggers to execute piston on desired conditions.
The major reason for such design is to make it possible to tap tile on dashboard to toggle the switch. I like it because I could keep all the logic in a single piston. It is also easy to test such pistons.

However I’ve been noticing “ghost” piston execution. Apparently that are “recovery” piston calls.
So the question is - how I could I detect that current piston execution is cause by recovery so I could skip toggling the switch?


#2

Not sure if that matters - Hubitat hub and Webcore for Hubitat


#3

I moved this thread to the “Hubitat” category so you will (hopefully) get better visibility from other Hubitat users.


#4

It would be good to understand how often that is happening.

In general a recovery time event should only happen if a schedule was missed and this normally should not happen often (but it can happen if you restart your HE hub; shut it down, then restart it; it hung and you had to restart it. – you get the idea - the hub was restarted).

There is a hub restarted event available in webcore on HE, see the post in the webcore forum as it is described a a recent new feature).

If you are seeing this a lot, or absent hub restarts, it would be good to understand.

You have the option each time your piston runs (or does the toggle) to save the current time to a local variable, then you could compare when you last ran/toggled.


#5

When you look at the logs, each execution typically starts with Received event $currentEventDevice.$currentEventAttribute = $currentEventValue so if you are seeing the type of recovery that appears as [Your Location].execute = recovery that should be easy to pick up. Unfortunately there is also the type that appears as[Your Location].time/recovery = <time> and in that case/recovery is just text written after the $currentEventAttribute which is simply time.


#6

Thanks - instead of detecting recovery (and potentially other conditions) I’m now detecting only tile click now using $currentEventAttribute == "tile".