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.

Scripting
#2
Hello mariosp

You should create event script with tag, and this tag should be for two group addresses
for actual temperature object and for temperature set point

Code:
local actual_temp = grp.getvalue('12/0/5')
local setpoint = grp.getvalue('3/1/1')
local pwm_addr = '4/1/1'

local zone0 = 0
local zone1 = 25
local zone2 = 50
local zone3 = 75
local zone4 = 100

local temp_diff = setpoint - actual_temp

--log(temp_diff)

if temp_diff >= 1 then
  grp.write(pwm_addr, zone4)
elseif temp_diff >= 0.7 then
  grp.write(pwm_addr, zone3)
elseif temp_diff >= 0.5 then
  grp.write(pwm_addr, zone2)
elseif temp_diff >= 0.3 then
  grp.write(pwm_addr, zone1)
else
  grp.write(pwm_addr, zone0)
end
Reply


Messages In This Thread
Scripting - by mariosp - 16.01.2025, 09:17
RE: Scripting - by RomansP - 16.01.2025, 10:05
RE: Scripting - by mariosp - 16.01.2025, 10:57
RE: Scripting - by Daniel - 16.01.2025, 11:02
RE: Scripting - by mariosp - 16.01.2025, 11:22
RE: Scripting - by Daniel - 16.01.2025, 11:29
RE: Scripting - by mariosp - 16.01.2025, 11:37
RE: Scripting - by Daniel - 16.01.2025, 11:43
RE: Scripting - by mariosp - 16.01.2025, 11:54
RE: Scripting - by RomansP - 16.01.2025, 11:59
RE: Scripting - by mariosp - 16.01.2025, 12:04
RE: Scripting - by RomansP - 16.01.2025, 12:09
RE: Scripting - by mariosp - 16.01.2025, 12:11
RE: Scripting - by Daniel - 16.01.2025, 12:23
RE: Scripting - by RomansP - 16.01.2025, 12:26
RE: Scripting - by mariosp - 17.01.2025, 12:15
RE: Scripting - by RomansP - 17.01.2025, 12:37
RE: Scripting - by mariosp - 18.01.2025, 08:14
RE: Scripting - by baggins - 18.01.2025, 10:11
RE: Scripting - by mariosp - 18.01.2025, 11:11
RE: Scripting - by admin - 18.01.2025, 11:12
RE: Scripting - by mariosp - 20.01.2025, 09:10
RE: Scripting - by RomansP - 20.01.2025, 10:07
RE: Scripting - by mariosp - 20.01.2025, 12:08
RE: Scripting - by admin - 20.01.2025, 12:24
RE: Scripting - by mariosp - 20.01.2025, 13:55
RE: Scripting - by admin - 20.01.2025, 13:57
RE: Scripting - by Erwin van der Zwart - 20.01.2025, 15:10
RE: Scripting - by mariosp - 20.01.2025, 15:25
RE: Scripting - by mariosp - 21.01.2025, 11:19
RE: Scripting - by admin - 21.01.2025, 11:31

Forum Jump: