Calculates the current duty cycle of any device with on/off cycles for the amount of time you specify. It is only possible to get data that ends in the current moment with this verb, not specific time frames in the past.
Check to make sure the dehumidifier is not running too much in the last 24 hours.
tell app “XTdb” to set theDutyCycle to duty cycle of “basement dehumidifier state” for 24 * hours if theDutyCycle is greater than 85 then display dialog “the dehumidifier is stuck on again!" end if