22.02.2021, 12:57
(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.