Trigger Action based on How Long a device has been On or Running?

Can this be done in PLEG? If yes, any examples?

This cold be useful for many things but my current use case…

Monitor AC unit for the length of time is is running
If running 1 hour…
turn Mode to OFF + Fan to ON
delay 20 minutes then…
turn Mode to Auto + Fan to Auto

ideas? examples?

thx!

Create a input device Parameter for your thermostat … for the ModeState variable.
You can call it ModeState

Then the conditions are:
HVACActive ModeState ne ‘Idle’
AutoOff HVACActive and (HVACActive; NOW > 1:00:00)
AutoReset AutoOff; NOW > 20:00

Add your actions to AutoOff and AutoReset.

I think the property I need may not be exposed in PLEG

The closest I see is “Thermostat Mode Changes” - Auto/Cool/Heat, but not what is current state (running/not) is.

I think I need HVAC_OperatingState1
… this is what I use in DataMine. It tells current state.

Can you see about allowing PLEG to expose this for use?

thx

If this is a Z-Wave thermostat than the Device Property is called ModeState!
This is NOT a trigger input … it’s a device property input.

DOH! Thank you… ;D

in the Condition you wrote: ModeState ne ‘Idle’
… is ‘ne’ mean ‘Not equal to’ ?

your syntax for Text strings shows: eq ne gt ge lt le
… but I did not find what the meanings were?

again, thanks for the help - and for the AMAZING plugin… seriously, the more I learn about it - wow.

They are typical string comparison operators
eq ne gt ge lt le

Are analogous to numeric operators
== != > >= < <=

Note that a string of 12 is less than 2 using string comparisons.
But 2 is less than 12 using numeric comparisons.