Logic Machine Forum
can't get floor heating lua script to work on wiser - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: can't get floor heating lua script to work on wiser (/showthread.php?tid=4373)



can't get floor heating lua script to work on wiser - h5345 - 10.11.2022

hi, i got to this forum by googling and found a post about floor heating and virtual thermostat https://forum.logicmachine.net/showthread.php?tid=3572&pid=23068

i have 4 temp sensors (which show up correctly in the objects tab, data type is 09.001 2 bytes floating point) and a 6 way heating actuator (i can activate its channels by switching the channels value to true or false in the objects tab, data type is 01.002 boolean)


i added the floor heating widget and configured it like the following
https://imgur.com/a/RzpfwDe

i added a resident script with a 60s cycle and activated it

this is the script i came up with

--on/off widget status
statoonoff = grp.getvalue('32/1/4')
--write temperature to variable
tstudio = grp.getvalue('0/0/78')
--write widget setpoint temp to variable
settemp = grp.getvalue('32/1/3')
--check if the widget is enabled
if statoonoff==1 then
--check if setpoint is lower or greater in that room
if (settemp > tstudio) then
-- if setpoint is greater switch actuator channel on
grp.write('0/1/19', true)
else
--if setpoint is lower then switch actuactor channel off
grp.write('0/1/19', false)
end
--if widget is set to off turn off heating
else
grp.write('0/1/19', false)
end

the script isnt working, does anyone know whats wrong with it?


RE: can't get floor heating lua script to work on wiser - admin - 10.11.2022

32/1/4 is most likely boolean so this if does not work:
Code:
if (statoonoff == 1) then

It should be compared with true/false not 1/0. It can also be simply written like this:
Code:
if statoonoff then



RE: can't get floor heating lua script to work on wiser - h5345 - 10.11.2022

(10.11.2022, 12:13)admin Wrote: 32/1/4 is most likely boolean so this if does not work:
Code:
if (statoonoff == 1) then

It should be compared with true/false not 1/0. It can also be simply written like this:
Code:
if statoonoff then


32/1/4 was 01.001 data type, idk why it wasnt working. I changed it to 01.002 and used

if statoonoff

and its working, so thank you!!