Lagging energy consumption, AC usage spikes

I'm trying to track my energy usage and keep it under my solar generation

in this graph the orange is the solar generation and the blue is the energy consumption

the main use of the energy is turning the air conditioner

as you can see the bump in the middle of the graph from the base 500w to 1.2kw

I set the air conditioner temperature based on a trim that increases and decreases the energy based on how much surplus solar, the distance between the blue and orange graph.

as you can see it goes to the maximum of +3 degrees right at the start which matches the shape of the graph


what I don't is why there is a ramp up in the consumption fomr 9.47-10.05
when the trim has not changed at all. Once consumption exceeds the generation, the trim comes down as expected and the graph follows down as well.

now for some background is a three phase air conditioner, i'm in Sydney it is winter the outside temperature is 17C, inside is set to 22C now. The rooms were 18-19C when it turned on at 9am.

we did not use anything else such as ovens or microwaves or anything that can explain the spike

currently I'm checking usage once per minute and adjusting the temperature and there might be a delay Even so it doesn't explain the gradual ramp up which goes for 15 minutes


it has just done this again

This is my code running once per minute I'll try and tone it down to every second minute

{% set surplus = states('sensor.surplus_solar') | float(0) %}

{% set step = 0.5 if surplus > 1200 else
              0.1 if surplus > 500 else
              0.0 if surplus > 0 else
              -0.2 if surplus > -500 else
              -0.8 %}

even stranger is even the ramp down is gradual


event at peak

the ramp down had completed by 10.39
and yet the consumption was still dropping until 10.47

when during this time it was already being increased again