This is my script for controlling my heater concrete slab, everything is working excepted in cold temperature the Geo stuck because geothermal output temp is too low, I added another probe on the geothermal output for monitoring this temperature.
Need help for introduced this new sensor for stop the Geo unit until she goes up a couple degrees for restart....
Any clue ?
Code: Select all
local heating_probe = 'SensorTempSlab' --Probe Name Concrete Slab
local heating_probe_geo = 'SensorTempGeo' --Probe Name Geothermal Outpout Slab
local thermostat_setpoint = 'Thermostat' --Virtual Thermostat
local heating_unit = 'GeoUnit' --Virtual Switch Relay On/off Geothermal Unit
local OnOff = 'Heating Slab On/Off' --Virtual Switch Script On/Off
local heating_probe_geo_consigne = 35 --Minimum Temp Geothermal Outpout Threshold (°c)
local hysteresis = 0.5 --Setting Hysteresis (°c)
commandArray = {}
if (otherdevices[OnOff]=='On') then
-- loop through all the devices
for deviceName,deviceValue in pairs(otherdevices) do
if (deviceName== thermostat_setpoint ) then
if tonumber(deviceValue) < tonumber(otherdevices[heating_probe]-hysteresis) then
if (otherdevices[heating_unit] == "On") then
commandArray[heating_unit]='Off'
print("Heating is Off")
end
elseif tonumber(deviceValue) > tonumber(otherdevices[heating_probe]+hysteresis) then
if (otherdevices[heating_unit] == "Off") then
commandArray[heating_unit]='On'
print("Heating is On")
end
end
end
end
-- loop through all the variables
for variableName,variableValue in pairs(uservariables) do
end
elseif (devicechanged[OnOff]=='Off') and (otherdevices[heating_unit]=='On') then
commandArray[heating_unit]='Off'
print ('chauffage extinction')
end
return commandArray