20.01.2025, 09:10
(18.01.2025, 11:12)admin Wrote: Explain exactly what do you want this script to do.
so its a littlebit complicated.
I have underfloor heating i want the pwm valves to not close and i want to change the %of the opening valve i want if the actual temperature
is higher than then setpoint to write to the group address of the heating actuator the setpoint - the offset that my client will set
but if the actual temperature is lower than the set i want to write to group address of the heating actuator the actual temperature so it will open more if need it heres is the script that i end up. Thank you in advance!
Code:
if event.getvalue() then
-- actual temperature of room1
local actual_temp1 = grp.getvalue('12/0/5')
-- group address of the heating actuator for temperature
local fake_temp_addr1 = '3/3/1'
-- virtual group address that i created for mosaic
local offsetvalue = grp.getvalue('32/1/69')
-- master setpoint for all rooms
local value_temp = grp.getvalue('12/1/0')
--setpoint of room
local value_temp1 = grp.getvalue('3/1/1')
-- for mosaic because that i made it with rotary dimmer
local offset = value_temp - offsetvalue * 0.01
if actual_temp1 >= value_temp or value_temp1
then
grp.write(fake_temp_addr1,offset)
else
grp.write(fake_temp_addr1,actual_temp1)