Adding a custom unit conversion

#1

We need to convert from volt_ampere to watt with a nominal power factor of 1, making it a 1:1 relationship.
W = VA*PF, where PF=1.
The watt and volt_ampere units are already added in the Unit type. I’ve added a UnitOfConversion and reprovisioned.
{
“sourceUom” : “watt”,
“targetUom” : “volt_ampere”,
“conversionFactor” : 1,
“id” : “watt_volt_ampere”
}

I see the UnitOfConversion record for watt to volt_ampere, but the Unit is still showing them and not convertible.
Unit.isConvertable(“watt”,“volt_ampere”)
false
Unit.isConvertable(“volt_ampere”,“watt”)
false

Is there something else that needs to be done other than adding the Unit and UnitOfConversion records?

0 Likes

#2

The UnitOfConversion is not needed for converting from watts to volt-ampere. I discovered a bug in the base that will address this problem.

0 Likes