29.07.2024, 06:24
Status object must be passed as the 4th argument. You need to pass status group address not value:
Some notes on your script:
1. Passing datatype to grp.getvalue() is not needed in most cases.
2. INtemp is converted to integer via math.ceil but then compared with a floating point value (21.5). You can either remove math.ceil or compare with an integer value (INtemp >= 22)
3. Instead of comparing with true/false you can simply use if Porucha1 and Porucha2 then
4. Generally it is recommended to use all lowercase variable names as mixed case can lead to errors due to typos because variables in Lua are case-sensitive.
Code:
value = not Antizamrz and INtemp > 21.5 and VZT and Outtemp > 20
grp.checkwrite('11/1/13', value, nil, '11/1/113')
Some notes on your script:
1. Passing datatype to grp.getvalue() is not needed in most cases.
2. INtemp is converted to integer via math.ceil but then compared with a floating point value (21.5). You can either remove math.ceil or compare with an integer value (INtemp >= 22)
3. Instead of comparing with true/false you can simply use if Porucha1 and Porucha2 then
4. Generally it is recommended to use all lowercase variable names as mixed case can lead to errors due to typos because variables in Lua are case-sensitive.