I’m trying to set voltage but I’m noticing that it is off by about 10.76817 times. 208v > 19.324v | 480v > 44.59v. I’ve also noticed that F temperature was an issue as you can see below so I have a conversion there but was wondering if there is something else I should do for both of these examples.
Interestingly based on the formula it looks like it is somehow related both to Celcius and Rankine.
if v != None:
if p.Definition.GetDataType() == SpecTypeId.HvacTemperature or p.Definition.GetDataType() == SpecTypeId.PipingTemperature:
for ty in famType:
famMan.CurrentType = ty
try:
famMan.Set(p,(459.67 + v)/1.8)
except:
pass
else:
for ty in famType:
famMan.CurrentType = ty
try:
famMan.Set(p,v)
except:
pass
UPDATE:
I found UnitUtils from a dynamo forum post and came up with this to test what I would get.
elif p.Definition.GetDataType() == SpecTypeId.ElectricalPotential:
print(UnitUtils.ConvertToInternalUnits(v,UnitTypeId.Volts))
for ty in famType:
famMan.CurrentType = ty
try:
famMan.Set(p,v)
except:
pass
The print returned 2238.89336668 which when divided by 10.7… is 208. Ended up using this:
elif p.Definition.GetDataType() == SpecTypeId.ElectricalPotential:
for ty in famType:
famMan.CurrentType = ty
try:
famMan.Set(p,UnitUtils.ConvertToInternalUnits(v,UnitTypeId.Volts))
except:
pass