Jump to content

decimals and advanced math or special functions


johnnyt

Recommended Posts

Posted

Hi, will we (can we) see decimals and more advanced math functions in 5.0?

 

There are a couple of key math calculations for which I currently still need HomeSeer in order for my HVAC automation to be optimal. To migrate this functionality to ISY (and finally shudown HS) I will either need them as built-in functions (the result can be an integer) or have the ability to process floating point numbers and work with exponents.

 

The first formula is the relatively well known heat index or humidex calculation, which results in the "feels like" temperature you find at weather web sites:

 

Indoor_Heat_Index = Indoor_Temp + 5/9 * ((6.112*10^(7.5*Indoor_Temp/(237.7+Indoor_Temp))*Indoor_Humid/100)-10)

 

 

The second takes a little more explanation. I call it the "Equivalent Humidity" calculation. It takes an outdoor temp (t2) and calculates, based on an indoor temp and humidity (t1 and rh1), what the humidity outdoor would have to be to equate (approx.) the indoor humidity. The formula I found is calibrated for 30 Celcius - not as good as the 20 C calibration I would have liked, but it's what I was able to find (and it took quite a while to find this).

 

The application of this is in the controlling of venting from the outdoors. Because relative humidity changes with temperature, i.e. when you bring cooler air into warmer air the RH comes down and vice versa, I use it to make sure I don't bring in excessive moisture when I vent a cold store as well as my house (via HRV).

 

Here's the vb code I run in HS. It also provides "vapor" and "dew" point but I don't use those values.

' t1 = ColdStore Temp from ISY
' t2 = Outdoor Temp from ISY
' rh1 = ColdStore Humidity from ISY

t1 = t1 + 273
t2 = t2 + 273
        
p0 = 1113360648
deltaH = 43760
R = 8.314
            
dim sat_p1    
dim sat_p2    
dim vapor    
dim dew
dim rh2

    sat_p1 = p0 * math.Exp(-deltaH/(R*t1))
    sat_p2 = p0 * math.Exp(-deltaH/(R*t2))
    vapor = sat_p1 * rh1/100
    rh2 = (vapor/sat_p2)*100
    dew = -deltaH/(R*Math.log(vapor/p0)) - 273

    vapor = Math.round(vapor*10,0)/10
    dew   = Math.round(dew*10,0)/10
    rh2   = Math.round(rh2,0)

if rh2 > 100
  rh2 = 100
End If
Posted

I'm in the same boat, being a Canuck.  Right now I calculate humidex myself using my thermostat Link program.  I assume you're using an Insteon unit or something native.

If UDI don't get advanced math into V5 then I'm going to write a program to sit on a RPi to do it (read in ISY variables, do math, write to new ISY variables).

Posted

I'm in the same boat, being a Canuck.  Right now I calculate humidex myself using my thermostat Link program.  I assume you're using an Insteon unit or something native.

If UDI don't get advanced math into V5 then I'm going to write a program to sit on a RPi to do it (read in ISY variables, do math, write to new ISY variables).

I don't think it's just us Canucks that could use humidity calculations. I think the more northern states also deal with humidity and I know from experience Floridians can feel the heat index in the summer (feels like 113F when it's 91F  in Sarasota right now). We're just maybe more aware of it because it's also a wintertime issue for us.

if by "insteon unit" you mean thermostat, I had an RCS RS485 thermostat that HS worked with but the comms on it went. I'm waiting for AARtech to stock the ISY zwave module to buy it and a zwave stat.

  • 2 weeks later...
Posted

Just another request for some decimal formatting in the notifications at least. These are text string formatted output only.

Out:${var.2.7,2} C, ${var.2.10,2}% RH, ${var.2.12,1} kph, ${var.2.7}

Output sample

 

  Out:23.30 C, 56.40% RH, 20.6 kph, 2330

 

 

 

Edit: Added backward compatibility demo, without decimal point parameter, to end of sample.

  • 1 year later...
Posted

Hello, 

 

I am on 5.0.4, but I cannot seem to use decimals in my variables. Is this still a planned feature for 5.x? Do you think it might be in the next 5.x release? 

Posted

Hello, 

 

I am on 5.0.4, but I cannot seem to use decimals in my variables. Is this still a planned feature for 5.x? Do you think it might be in the next 5.x release? 

See post #5.

I have been using decimals for quite a few months now, since v5.0.2

 

Did you define any variables you want to use as having decimals?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...