16.01.2025, 09:17 (This post was last modified: 16.01.2025, 09:27 by mariosp.)
Hello guys i made a script and i need you help
I have underfloor heating and i want to make zones o pwm vavles . what i mean that if the setpoint bigger than the actual temperature by 1C then the valves must be open 100% , if the setpoint bigger than the actual temperature by 0.7 C then the valves must be open 75% and so on.
here is the scrpict that i made but doest work and i dont get any error
-- zone* = value of the valve
zone0 = 0
zone1 = 25
zone2 = 50
zone3 = 75
zone4 = 100
-- 3/1/1 set point
-- 12/0/5 actual temperature
if grp.getvalue('3/1/1') > grp.getvalue('12/0/5') - 1
then grp.write('4/1/1',zone4)
elseif
grp.getvalue('3/1/1') > grp.getvalue('12/0/5') - 0.7
then grp.write('4/1/1',zone3)
elseif
grp.getvalue('3/1/1') > grp.getvalue('12/0/5') - 0.5
then grp.write('4/1/1',zone2)
elseif
grp.getvalue('3/1/1') > grp.getvalue('12/0/5') - 0.3
then grp.write('4/1/1',zone1)
elseif
(grp.getvalue'3/1/1') == grp.getvalue('12/0/5')
then grp.write('4/1/1',zone0)
For you, you can ignore the Local declaration as variables in a script are only in this script. You cannot use them anywhere else. For this script it makes no difference but it is a good programing practice.
But in this type of script variables are only in this one script.
In LogicMachine it only make sense to use local declaration if you use
loops or functions. But for me putting local in this script is just like a
good practice, to do not use global variables.
17.01.2025, 12:15 (This post was last modified: 17.01.2025, 12:16 by mariosp.)
(16.01.2025, 12:26)RomansP Wrote: But in this type of script variables are only in this one script.
In LogicMachine it only make sense to use local declaration if you use
loops or functions. But for me putting local in this script is just like a
good practice, to do not use global variables.
Hello again unfortunately this doesnt work for me the script works fine but the heating actuator doesnt chages the actual value but only the status!
can you you help me write a script that i will write the value of the actual temperature to another group address but with -1C temperature lower i made this but doesnt work! thank you in advance!
Code:
local actual_temp = ('12/0/1')
local fake_temp_adr = ('32/1/68')
local value = ('12/0/1')-(1)
if grp.getvalue('32/1/66',1)
then
grp.write('32/1/68',value)
else log()
17.01.2025, 12:37 (This post was last modified: 17.01.2025, 12:38 by RomansP.)
Hi
If I understood you correctly, each time when will be new temperature value,
then this value will be subtracted by 1, and sent to another group address.
Then just create an event script for temperature object '12/0/1'
Code:
local value_temp = event.getvalue()
local fake_temp_addr = '32/1/68'
18.01.2025, 08:14 (This post was last modified: 18.01.2025, 08:46 by mariosp.)
thank you for your help! I will heed your you help once again
I ended up with the below script that is a event based on the setpoint to change the offset but only if the actual temperature is higher than the setpoint here is the script that i made that doesnt work.
Code:
local setpoint = event.getvalue()
local actual_temp = '12/0/5'
local zone1 = grp.getvalue('3/3/1') - (0.1)
local temp_diff = setpoint - actual_temp
(18.01.2025, 08:14)mariosp Wrote: thank you for your help! I will heed your you help once again
I ended up with the below script that is a event based on the setpoint to change the offset but only if the actual temperature is higher than the setpoint here is the script that i made that doesnt work.
Code:
local setpoint = event.getvalue()
local actual_temp = '12/0/5'
local zone1 = grp.getvalue('3/3/1') - (0.1)
local temp_diff = setpoint - actual_temp