This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Script humidity and heating
#1
Good afternoon,
I want to create a script with the following options, but I can't figure it out.

I have a humidity measurement and a floor/room temperature.

The underfloor heating should turn on when the humidity exceeds the set value. However, the floor must not get warmer than 29 degrees Celsius. The underfloor heating should also turn on when the temperature inside reaches 5 degrees Celsius.

The ventilation should also turn on when the moisture content exceeds the set value. It's regulated from 1 to 100% and should increase in speed in several steps.

Room temperatureĀ 
3/1/1
Floor temperature
3/2/1
Humidity
4/1/1
Maximum humidity
4/2/1
Switch underfloor heating
3/4/1 (1-bit)
Ventilation
5/1/1 (1-byte)

Thanks in advance for your help.
Reply
#2
Are you sure you don't need a setpoint for room temperature?

For ventilation you can create a setpoint object for each speed. Use a scheduled script that runs every minute.
Code:
humidity = grp.getvalue('4/1/1')

setpoint_min = grp.getvalue('32/1/1')
setpoint_med = grp.getvalue('32/1/2')
setpoint_max = grp.getvalue('32/1/3')

if humidity >= setpoint_max then
  out = 100
elseif humidity >= setpoint_med then
  out = 66
elseif humidity >= setpoint_min then
  out = 33
else
  out = 0
end

grp.checkwrite('5/1/1', out)
Reply
#3
Thanks, admin, for the setup.

It's true that I'm not controlling the room temperature, but the humidity.
This is for a pigeon enclosure where the humidity needs to be a certain value.

But this is not quite what I mean.
I'm missing the floor temperature, which shouldn't exceed 29 degrees Celsius.
And the frost protection, which also turns on the heating at 5 degrees Celsius, until the indoor temperature reaches a maximum of 7 degrees Celsius.

I don't understand the setup with the setpoint min, med, and max, because I only have one humidity setpoint to control and the ventilation has fixed positions andĀ And are not customizable by the end customer

Thanks in advance.
Reply
#4
I suppose it can be simplified a bit. The logic is as follows:
1st priority = turn on heating if room temperature is 6 degrees or lower
2nd priority = turn off heating if floor temperature is 29 degrees or higher
3rd priority = turn on heating if humidity is equal or larger than the setpoint

You can use the same scheduled script that runs once a minute.
Code:
room_temp = grp.getvalue('3/1/1')
floor_temp = grp.getvalue('3/2/1')
humidity = grp.getvalue('4/1/1')
hum_setpoint = grp.getvalue('4/2/1')

if room_temp <= 6 then
  heating = true
elseif floor_temp >= 29 then
  heating = false
else
  heating = humidity >= hum_setpoint
end

grp.write('3/4/1', heating)

For ventilation you said there are several speeds hence the 3 different setpoints for each speed. Alternatively you can use a single setpoint and calculate the next setpoint by adding some fixed amount or percentage.
Reply


Forum Jump: