Hi, in Norway a new electricity usage policy is going to be implemented next year. If I use more than a certain amount of kWh within 1 hour, I get a penalty for the entire month. There will likely be two steps, 5kWh and an even higher penalty if I use >10kWh. One quite efficient way for me to keep below 5kWh is to turn off power to the water heater (2kW) for a period. I use Home Assistant for this. Currently HA turns off the heater after 15 min of >5kW usage. A better rule would be to accumulate Wh every hour and turn the heater off when exceeding a maximum value (4, maybe 4.5 kWh?).
Can anyone help me adding calculations to achieve this?