Automated Device Management Based on Energy Consumption

I have a shower connected to a circuit breaker, and I would like to request an automated scenario for when the shower is turned on.

Condition 01:
If the real-time power consumption of the Shower Device exceeds 1KW, a 20-minute timer will start. Once the timer ends, the shower will automatically turn off.

Condition 02:
If the power consumption of the Videogame Device exceeds 0.1KW/h (measured over the past XX hours), the device will be automatically turned off.

Reason for these features:
In Condition 01, the goal is to limit the duration of the shower to prevent extended use, particularly by my daughter.
In Condition 02, this allows us to monitor the power usage of the device and automatically turn it off based on its energy consumption over a specific period, ensuring more efficient usage.