Running 2.3 but had the same issue with release 2.2.
I realized that when I e.g. press a HomeMatic PB and I had reloaded the rules (reboot, editing the rules regardless if the rule target this particular HM PB) 1-2 times the rule targeting this HM PB does not fire. In the log that HM PB event is coming through (OFF to ON, ON to OFF). It might be also that the rule takes too long for my patience, so I am retriggering it.
It regardless how long I wait after rebooting/refreshing the rules. And it applies for each and every when staement in the rule, e.g. 3 PBās acting on the same light with all SHORT and LONG press when clauses.
This is nerving because I have to go arround all the PBās at reactive them by pushing all sequences through multiple times before handing over system to my wife.
Any idea what that can be? How to solve this issue?
Ive witnessed the same behavior in my system (pretty sure itās been around since at least 2.1), where the first execution will have a 5-10 second delay, then all the executed rules fire at once. This happens on first startup and any time the .rules file is reloaded. Rules are instant after that. Logs show the triggering event immediately, with a delay until the rule log entries show up.
Not a big deal for me since I know they are still working, but just confirming this isnāt an isolated issue.
I am using Pi3.
Regardless how I wait after refresh/restart of rules.
I have a log statement a first line after the when statement, so the size of the rule should not matter
Unfortunately I am not at home for next 3 days, cannot deliver this and wouldāt mess with system when I am not at home.
But the logs do not show anything in particular, except I had to increase log level for rule based execution, which I do not know
This old stuff '16 prior to 2.1, which seems the time it start hapening.
It seems not to be the a solution to trigger the rule, but trigger all the āwhen paths/clausesā, because is seems that they are treated separately.
Iām no founder and I donāt do development on OH or ESH. Iām just a user and support the project by helping out on the forum. But that means Iām pretty limited in what I can do to help with a problem like this. All I can do is commiserate and say it shouldnāt do that. Nothing more.
This does not explain my situation. here the rules snapshot:
rule LivingFPRemoteL1L3
when
Item LivingFPRemoteL1 changed from OFF to ON or
Item KitchenRemoteL3 changed from OFF to ON
then
logInfo("rule LivingFPRemoteL1L3", "start")
try{
if ( gTFDRLightSpot.state as Number > 0 )
{ sendCommand(gTFDRLightSpot, "0")}
else
{sendCommand(gTFDRLightSpot, "10")}
} catch(Exception e) {sendCommand(gTFDRLightSpot, "0")}
end
rule LivingFPRemoteS1S3
when
Item LivingFPRemoteS1 changed from OFF to ON or
Item KitchenRemoteS3 changed from OFF to ON
then
logInfo("rule LivingFPRemoteS1S3", "start")
try{
if ( gTFDRLightSpot.state as Number > 0 )
{ sendCommand(gTFDRLightSpot, "0")}
else
{sendCommand(gTFDRLightSpot, "100")}
} catch(Exception e) {sendCommand(gTFDRLightSpot, "0")}
end
There are two wall mount switches (homematic 6 PBs) which operate set of tradfri ceiling GU10 spots. operation short=full long=10% power.
When rebooting or even reloading particular rules file (maybe also any rulesfile?), I have to go physically (pushing PBs) over all options in these rules (L1, L3, S1, S3).
The behavior is 4 times the same:
1st push nothing, waiting (how long?, left it for a minute, nothing)
2nd push nothing
3rd push light goes on
looking at the log file I see entries for homematic going OFF-ON-OFF, but evidence executin the rules
This cannot be just the precompiling of rule(s)?
I have the same behavior on other rule triggering items, though all homematic.channels.
I think I had the same issue. I am not sure, but I think it was related to the homematic raspberrymatic beeing connected via Powerline. I changed it to a direct connection and I didnāt observe the behavior again.
So check for latency in your network. Also duty cycle is causing issue from time to time.
I had in my rules the when statement for items (push buttons) going OFF to ON, unfortunately the initial state of the pushbutton item after boot is NULL and goes to ON. So I I will eliminate the āFROMā statement from my WHEN caluse.
when
Item KitchenRemoteL1 changed from OFF to ON
then
to
when
Item KitchenRemoteL1 changed to ON
then
I tested following and it seems to be the solution:
Enter in each rules file a rule which does nothing except putting some log output, triggered by System started
rule "System started Rule"
when
System started
then
logInfo("System started Rule", "done")
end
The whole rules file is precompiled.
The good thing is that when you save the rule is compiled, as for some reason the System started is triggered for this rules file !!??
An idea would be also to set a cron target in this rule as well, e.g. once an hour, i.O. to to keep the rule file loaded. Just as an idea I didnāt tested that.