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
#6
(22.02.2021, 11:20)admin Wrote: You should also check if the storage value is not a table otherwise the script will produce an error. Corrected version:
Code:
-- Creating database for global variables and initialized to ZERO only first time of script use
HumidDB = storage.get('Humid')

if type(HumidDB) ~= 'table' or next(HumidDB) == nil then

Thank you very much admin, I've changed the code in my script.
I assume it isn't necessary to post the complete code again or do I change my initial post?

For those interested, this script is also usefull to control a ventilator for heating purposes by changing the variable values, group addresses. Certainly set fan_max_timer > 120 (2 hours)

I will use it to start a ventilator once the air in a ventilation pipe gets to a certain temperature.
If you run 2 scripts of those, you need to change the table name also.
Reply


Messages In This Thread
RE: LUA Script - Control humidity in bathroom - by tigi - 22.02.2021, 12:57

Forum Jump: