Actions based on power consumption

Not sure where to post this.

I keep a device plugged into and charging from an ST Outlet. When the device battery is charging the wattage on the outlet is at 7W, and when it’s full the wattage drops to 2W(I know where the 2W is coming from). I want to run charge cycles so the battery doesn’t get messed up.
Is it possible to create a rule that switches the outlet off when consumption drops to a certain threshold, in this case 2W?
The device battery will run for 5.5 hours, so I can set an independent alarm reminding me to switch the outlet back on. Although a rule to create a 2hrs-on/5hrs-off cycle could work, 2 hours being about as long as it takes the battery to charge fully. Unfortunately the device does not automatically power on when it’s plugged in so I can’t let the battery die when I’m not there.

I’m open to any other thoughts on how get this to work.

Did you search this topic. I have seen this addressed in the past. Core is the answer.