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.

LUA Script - Control humidity in bathroom
#3
(19.02.2021, 12:18)admin Wrote: For storage I recommend using a single table with values instead of multiple storage entries. You also have TEST_MODE_HUMVAR in quotes which means it will try to access "TEST_MODE_HUMVAR" storage item not an item that is contained in the TEST_MODE_HUMVAR variable. toInteger calls are not needed.

Thank you admin for the quick review! Cool

I've changed the TEST_MODE_HUMVAR part. I didn't quite test that part out, now I did.
As it seems, it doesn't need to be in storage anyway. On top of that it didn't work like it was for this Logicmachine knx script, I've tweaked it a little bit and now it works. Value 50 will stop the fan, any value above 55 will start the fan.

I've removed the toInterger calls and the function. Very strange it works without, I removed it initially but because at the time of porting and testing I encountered a strange behaviour in the calculated delta value (e.g. when delta should be 0 I got like 7.1...) which disappeared when re-adding the initial toInterger function. Better if it isn't needed indeed and it works without!

I've also placed the FanValveState() in the if-then PRINT_MODE statement, so it only is executed when logging is enabled.

As of now I haven't changed the storage part into a single table because of the lack of necessary knowledge. I'll get there eventually I hope and will change it then.
Reply


Messages In This Thread
RE: LUA Script - Control humidity in bathroom - by tigi - 19.02.2021, 18:04

Forum Jump: