Calculation of efficiency => disvison

Hi !

im trying to calculate the efficiency of my photovoltaic.
I have 3 values (all are numbers) but im struggeling with the line in the roule
I have I1 and I2 which is the input and O is the output…E will be Efficiency
The calc should be:
so in my rules
E.postUpdate((O.state as Number / (I1.state as Number + I2.state as Number)) * 100)

but system say / is illegal

Do you have a hint ?

Ciao Gerd

Stop trying to do everything in one line. Do one step at a time, and see where it trips up.

Are you sure your starting Items are Numbers, and not quantities with units?

Yes they are numbers

Well, your code is secret, and even the error message
I can’t think of any more hints from that.
If you break your code into steps, you could log out intermediate values so you can see if things are what you expect.

Ok … im experienced enought to say that these are numbers … because they are defined as numbers and they are displayed correctly in the site map as a number… but here we go…

Number U1
Number U2
Number A1
Number A2
Number O
Number I1
Number I2

I1 and I2 are calculated in Rules by Ux*Ax=Ix (and this works already like charm)
like e.g.

Item U1 changed or
Item A1 changed
I1.postUpdate(U1.state as Number * A1.state as Number)

and in next rule should be calculated like in my first post
(O/(I1+I2)) * 100

ciao Gerd

Parentheses are needed in each X as Number

E.postUpdate((O.state as Number) / ((I1.state as Number) + (I2.state as Number)) * 100)