Assist with creating templates to determine current draw

A while ago, I was looking for a way to derive current consumption from my UPSes that do not offer that and I think templates are the way to go. I am NOT a programmer and I got about half of it done but I want to use two values.

The formula is (1500VA * output load) / voltage.

My output load comes in the form of a percentage so I am thinking that since something like 16% is 0.16, I could move the decimal point two spots to the left and multiply

(15 * output load in percentage) and divide by the voltage.

So, I created this part but I do not know how to add that second operation to the formula to determine current consumption.

Voltage: sensor.kah_ups01_input_voltage
Output Load:|sensor. kah_ups01_output_load

{{ states('sensor.kah_ups01_output_load') | float(0) * 15}} gets me that 240 I would get when I multiply 1500VA * 16%. I just used the communitive property of multiplication to reverse it so percentage * 1500 and divided each side by 100 since 16% is 0.16 so it is 16 * the 15 hundred volt-amps.

I just do not know how to take that and divide it by “sensor.kah_ups01_input_voltage”

There are many ways to write it, but basically you use the same states() function followed by float filter to get the voltage value as a float…

{{ (states('sensor.kah_ups01_output_load') | float(0) * 15) / states('sensor.kah_ups01_input_voltage') | float(0) }}

If you prefer you can use variables to make it a little more readable at a glance:

{% set load_percent = states('sensor.kah_ups01_output_load') | float(0) %}
{% set voltage = states('sensor.kah_ups01_input_voltage') | float(0) %}
{{ (load_percent * 15) / voltage }}

Thank you!!!