Home kit automations based on persistent values?


Home kit homebridge user since that beginning here.
Might be missing something obvious here, or searching for the wrong terms, but I can not seem to find a way to do automations based on values over time and simple math. Is this possible? Are there workarounds?

As an example automation:
If an accessory has been drawing a certain amount of power for more than a set amount of time, notify me.

if a value (X) is above a certain value (V) for a set amount of time (Y) : set an accessory state ยง

That kind of thing. Any hints appreciated. Many thanks.