Inferring current power from lifetime energy (A/C)

I have an air conditioner in my shed which was installed in 2018. I have got it working with HomeAssistant, but it does not have a power monitoring feature. It would be good to monitor current power usage.

I looked into using a normal smart plug with energy monitoring, such as the Tapo P110M, of which I have several, but the Amazon listing cautions against using it for air conditioners for some reason.

However, the air conditioner does have a lifetime energy entity that is exposed with the HomeAssistant integration. In theory, it should be possible to infer approximate current power usage by monitoring changes in this value over fixed periods of time.

Does anyone have any idea how to achieve this in HomeAssistant? Thank you in advance.

Air conditioners, fridges and the like have a large motor driven compressor, usually with a large start-up capacitor. These both take a very hefty current for a very short period of time at start, which is usually not a problem for old fashioned fuses. Modern electronics however may get fried. Whilst the running current of, a fridge say, is only 4 amps for a 1 kW power (240 volts nominal) the startup current usually requires a full 13 amp cable and fuse.

I have a softub (hot tub) which draws 1 kW when running, but again has a large starting capacitor to get the motor going. That and a motor starting against a load means the starting draw current is again 3 to 4 times the running draw. I use a shelly 1PM in the supply, not to switch this but rather just to measure the power. This works fine. The Shelly has protection, and has been known to switch off when it falsely detected over voltage, and again more recently when the starter capacitor packed up and the starting current exceeded the safety margin. The Shelly turned off before my consumer unit MCB did, which is quite reassuring. Otherwise my Shelly does a good job of power monitoring.

In terms of working off ‘lifetime energy’, you will have a figure that represents the total used energy in kWh or similar. Naturally it is possible to infer back to power, since power is just rate of energy use, and the derivative (fx / DX) integration can do this for you. We normally use the Reimann Sum (integration) to go from power to energy, and the Derivative goes in reverse from energy to power.

Although the Derivative would seem to be a very useful sensor, I have struggled to get much sense from it. Like most things, it works best with a consistent and frequently updated input sensor, and will return the rate of change quite nicely. For things that get switched off most of the time, the results are not so helpful. Getting the sampling rate set can be tricky.

I have, for amusement really, a ‘rate of change of SOC’ on my solar battery. This tells me the rate of charge or discharge as % per hour. I have also experimented with taking the tub power (kW) to energy (Reimann, kWh) and then going back to power (DX) in reverse to see if they are indeed inverse functions of each other. OK on a good day, and better with the time-weighted average of the derivatives option I think. Perhaps worth experimenting with?

You can find derivative as a Helper > fx Derivative Sensor.

Excellent, thank you, that is very helpful. I have set that up but will not be sure that it is working until I next turn on the air conditioning unit. Can you recommend a suitable time period for it?

Thank you again.

That is the big question.

HA is a state model, and all these integrations get triggered when the source sensor state changes - leaving the integration (Reimann sum, Derivative) with both the current value and the last value.

The Derviative, I assume, uses the change in the value and time period between changes to work out the rate of change. Simply (ThisValue - LastValue) / (ThisTime - LastTime).

When something changes often this will be a sensible value. When something only changes when it is running, then the starting and ending values are rubbish. Hence the time sample. I have tried 5 minutes, and this smooths out the jump between 0 and a ‘running value’. Works for a source sensor that changes more than once in 5 minutes.

If your ‘lifetime energy’ only goes up in 0.1 kWh jumps, then the source sensor will only change every 6-10 minutes, hence the sampling size should probably be say double this. I am guessing and hopefully someone will know the ‘correct’ answer.

I say try it and see.

Thank you. I will try 1 minute and see how it goes.