So here is what I finally settled on. After giving the circumstances some consideration, I realized that querying for a permanent hold status wasn’t the best approach.
To recap the issue, I have thermostats that get set back to a permanent hold through either manual entry at the thermostat, through the thermostat’s app or through an IFTTT routine. My goal was to release that permanent hold from the thermostat through some presence routine.
As additional requirements, I didn’t want sloppy code that fired when not needed. I also wanted performance for others that do not use the Smartthings app.
I decided to release the holds based upon motion from select motion sensors so that any occupant of the house would trip the routine upon occupancy.
Using webCore, I defined an Or-If statement that resets the thermostat based on two conditions, a motion sensor changing to Active and a temperature reading from the thermostat set below or above a certain temperature. For the temperature trigger points, I picked values two degrees below the typical setpoint (for the winter) and two degrees above the typical setpoint for the summer.
Using temperature readings from the thermostat as trigger requirements allows for a delay or sorts. When the thermostat is set low in the winter, for example, it will be a while before the temperature drifts down 2 degrees. So if the permanent hold is set a the thermostat for example, You can still walk around the house for a while and not inadvertently release the hold on the thermostat right after you set it. It also keeps the code clean by limiting firing when the thermostat is in the permanent hold mode (assumed by temperature above or below normal setpoints).
So basically the rule i.e. piston goes something like this.
IF x motion sensor changes to Active AND temperature is at or below 67 degrees, OR
IF x motion sensor changes to Active AND temperature is at or above 77 degrees, THEN
Run the routine to release the permanent hold from the thermostat.
Hope this helps someone!