Problem with luup.call_delay nexted in luup.call_timer
-
Hi Ak,
Not sure when it started as it took me a while to notice.
I have a function on a luup.call_timer to turn on a switch and then use a luup.call_delay to turn it off a minute later. This is done by the same global function, but on the luup.call_delay i get a message in the log : "luup.call_delay:: unknown global function name: HouseDevice1_PumpCommand"
This is in the init function:
luup.call_timer("HouseDevice1_PumpCommand", 2, "2:15:00", hm_Heating.PumpHealthRunDay, hm_Heating.PumpCMD.HEALTH.."1", true)
This is in the function to schedule to off command giving the global function name not found:
luup.call_delay("HouseDevice1_PumpCommand", hm_Heating.PumpHealthOnDuration, hm_Heating.PumpCMD.HEALTH.."0")
Is it because I use the "TRUE" parameter that is openLuup specific so the timer does not fire just once?
Running v21.7.25, may be time to update?
Cheers Rene
-
I need to see a bit more to understand your code. Is this is Startup, or within a device plugin, or what? Where exactly are the call in relation to one another?
Certainly the undocumented true parameter is for internal openLuup use only (it's used to recurring timers and scene schedules.)
The error message indicates that the calling code is not in the same Lua global context as the one that defined the names function.
-
Certainly this shouldn't have changed in very much more than one year, so I don't think that the version is an issue.
It's standard practice to be able to reschedule luup.delay() calls to the same function from within itself, so I'm rather perplexed as to why this might be, since the context should be right.
Can you try removing the true parameter and actually rescheduling the timer with another call to it from within itself, as you would have to do in Vera? I don't hold out a huge hope that this would change enything. Are you sayind that this used to work?