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.

Help with timer/time in LUA script
#1
Hi!


I am trying to controll my heating cable outside the front door, for melting the snow in winter.

I pulling the weather forecast in node red and get a "true" signal if the forecast says snow, and "false" it not.
I also want the outdoor temperature to control the time for the heating cable. ( so its not ON all the time)

My plan is to have OFF, AUTO and ON mode.
In OFF mode its forced off.
In ON mode its forced on.
In AUTO i want the outside temperature and forecast to control the "on" time.

Like, if the forecast is "true" and the temperature is between +4 and 0, the heating is ON in 25 minutes and OFF in 35 minutes, then repeat as long as the temperature is in range.

Then if the forecast is "true" and the temperature is between 0 to -4, the heating is ON for 35 minutes and OFF for 25 minutes, then repeat.

And if the forecast is "true" and the temperature is between -4 to -8, the heting is ON for 50 minutes an OFF for 10 minutes then repeat.

Something like that.

So how can i do this in LUA script, to get the times right?

i tried with os.sleep in resident script, but that doesnt work.

Any ideas? Cool
Reply


Messages In This Thread
Help with timer/time in LUA script - by stigen - 24.10.2020, 11:38

Forum Jump: