dzVents Not Handling Temperatures Correctly
Posted: Friday 07 July 2017 0:11
This may be a problem on my end but I could't find a solution here. I just may be missing something. I am using beta version 8057 (Fahrenheit scale) on a pi3 with some zwave & MySensors devices and just started to use dzVent scripts. The issue is when I ran this code:
Just a note: The temperature data comes from a MySensors node that I have set up to give me the temperatures of my drinking hot water, water heater flue temp, HVAC Supply Air Temp, HVAC Return Air Temp and the local space temp. I wanted to get a delta on the HVAC temp sensors. MySensors sends the temperatures to Domoticz in the Celcius scale and Domoticz converts it Fahrenheit. All worked well for the past two years until I started testing dzVents.
The dummy temperature sensor (HVAC Delta) in Domoticz was reading 39.5 degF however I knew that the delta was more like 4 degF. It looked liked somewhere along the way of the data going through Domoticz, it thought the delta (4) was in Celsius. Thus it re-calculated it back to Fahrenheit when actually it was already in the Fahrenheit scale. So I change the code to this to correct the issue.
After this change the dummy sensor displayed the correct value of 4.2. Is this a bug, I this me doing something wrong, please let me know what I am missing.
Just a note: The temperature data comes from a MySensors node that I have set up to give me the temperatures of my drinking hot water, water heater flue temp, HVAC Supply Air Temp, HVAC Return Air Temp and the local space temp. I wanted to get a delta on the HVAC temp sensors. MySensors sends the temperatures to Domoticz in the Celcius scale and Domoticz converts it Fahrenheit. All worked well for the past two years until I started testing dzVents.
Code: Select all
--[[
Assume you have two temperature sensors and a third dummy sensor that should be the
difference of these two sensors (e.g. you want to see the difference between water temperature
going into a radiator and the temperature of the water going out of it
]]--
return {
active = true,
on = {
['timer'] = {'every minute'}
},
execute = function(domoticz)
local inTemp = domoticz.devices('HVAC Return Air Temp').temperature
local outTemp = domoticz.devices('HVAC Supply Air Temp').temperature
local delta = math.abs(outTemp - inTemp) -- how much did the temperature change?
-- update the dummy sensor
domoticz.devices('HVAC Delta').updateTemperature(delta)
end
}Code: Select all
--[[
Assume you have two temperature sensors and a third dummy sensor that should be the
difference of these two sensors (e.g. you want to see the difference between water temperature
going into a radiator and the temperature of the water going out of it
]]--
return {
active = true,
on = {
['timer'] = {'every minute'}
},
execute = function(domoticz)
local inTemp = domoticz.devices('HVAC Return Air Temp').temperature
local outTemp = domoticz.devices('HVAC Supply Air Temp').temperature
local delta = math.abs(outTemp - inTemp) -- how much did the temperature change?
delta = (delta - 32) / 1.8
-- update the dummy sensor
domoticz.devices('HVAC Delta').updateTemperature(delta)
end
}