Thats my math:
PowerInLivingrooom.postUpdate((HIFI.state as Number) + (TV.state as Number))
if i have a swich without power measure. i know that there is power xxx watt.
Now i would like to add xxx to my livingroom power if the switch ist on.
does somebody have an idee?
The calculatuon of powerconsumption needs to take into account if the other powerswitch is off (unchanged calculation ) or on ( calculation + xxxx). A simple if clause would do.
Aditipnally you would to add a trigger for this calculaton in the change events of the powerswitch (in addition to the aleeady used triggers).