How do I automatically set a Zigbee power plug to "OFF"?


At the moment I use openHAB 4.
I have installed a Zigbee power plug as a thing… working very well.
To it a dust cleaner with chargeable batteries is connected.

From the power plug I receive the power in Watts and the current in A.

Now I want to set the power plug to do the following thing:

When for example the power is over 40 Watts it should activate the rule…
When the power is under 20 Watts for about 1 minute it should turn itself off.

With a trigger of a rule this is definitely not possible!
Can you tell me how I can set this up?

Thanks in advance!

Best regards

I have a similar rule:

Everytime the power consumption changes I’m checking the max power consumption of last 5 minutes. If it’s 0watt over 5 minutes I turn off the device

You can build such a rule easily with blockly