Variables not updating properly
-
In my use case I'm trying to setup a rule which would detect certain fan oscillation event. When this event happens, fan frequency oscillates between 0 and 5.8 Hz.
So I have the following rule:
One local variable called
osc_timer_armedand two global variables (g_oscCount,g_oscFlag), these are all expressionless. Originally all of these were local, but that didn't work so now trying with globals as well.The logic is that if there are at least 6 "pulses" (0 or 5.8 Hz) within a 30 minute time window, rule would then execute desired action (e.g. a notification).
Set reaction is:
The problem is that I'm never getting to the action part (group called "Action"), as
g_oscCountis not updating past 1 (and thereforeg_oscFlagis not set either). First "instance" of this rule is running for 30 minutes, butg_oscCountdoes not increase in subsequent runs.If I'm manually running the set reaction during this waiting (delay) time, I get the following runtime error on UI:
Error: Command timeout (1398 start_reaction) at _ClientAPI._commandTimeout (http://192.*.*.*:8111/client/ClientAPI.js:546:201)My hypothesis is that the first instance of the rule (running reaction) is locking these variables and other instances cannot modify them? Although could this even happen with global variables?
Build is 26011 on Docker. Didn't find any meaningful in the logs (could increase the logging level if needed).
p.s. Script action below to speed up reproducing this issue (no need for triggers, manually running set reaction is enough - the latter part of the reaction, group "Action" is not needed either)
g_oscCount = (g_oscCount ?? 0) + 1, g_oscFlag = ((g_oscCount ?? 0) >= 6) ? 1 : (g_oscFlag ?? 0)












