Using power wattage for dryer cycle status (off/cooling/heating)

I have energy reading appliance switches on my dryer, washer, and microwave (and more to follow). Using various plugins for countdown timers, combination switches, and variable containers, Vera now tells me the current state of the drying cycle. e.g. Off, Cooling, or Heating, based upon the wattage and duration.
This displays nicely on my phone with the Homewave app. My wife and I also get notified (via Prowl) when the cycle is complete, so we can empty the load etc.

Whist this is working well for me, each domestic appliance that I have set up requires a minimum of 6 virtual devices each (3 timers, 3 combination) and at least 6 scenes to operate them. This is a lot for each appliance. There must be a better or more efficient way of doing this. Does anyone have suggestions please of a plug-in or code that could replace the above complicated approach?

I think such a plugin would need to support at least 3 states, and each state would have a configurable power range and minimum duration to prevent it from falsely cycling between two states due to rapid power fluctuation that naturally occur. Would any of the existing plug-ins or LUA code help me reduce the number of virtual devices I currently have? I hope someone has suggestions. Thanks.

Example conditions that I currently use are:
Dryer:
Off: 0 to 4 watts; for 180 seconds
Cooling: 5 to 250 watts; for 90 seconds
Heating: 300 to 3000 watts; for 90 seconds
The scenes start and reset the timer so that the the “state” doesn’t change unless it has been in the new wattage range for a minimum of the required duration.

Look into using the Program Logic Event Generator plugin.

I’ve spent quite a few days trying to get to grips with PLEG. I’ve successfully implemented 3 different lighting scenarios that I’m very happy with, so I am reasonably comfortable with the basic principles. Unfortunately the logic for energy usage and timers is far too complex for me to master by myself. I really need a little help please.

I can see how to use the device properties to get the Watts, and to create a condition where Watts is between the values I want, but I don’t know how to add the time element.

In the example for Cooling, the range is 5 to 250 watts. But in reality, the readings may briefly (several seconds) drop below 5 watts. This is because the dryer does a reverse tumble, so it briefly stops before going into reverse. Therefore, I don’t want the Cooling condition to become false unless the watts is outside of the 5 to 250w range for at least 90 seconds (taking into account the appliance sample rate).

I just need a little nudge in the right direction please. Many thanks.