- openHABian 3.3.0 on rPi4 with 4GB
I am pondering over an issue I cannot explain.
I have a ‘universal timer’ (ut) in form of an Arduino with a relay output where I can set the on time and off time via MQTT.
At present the relay is ON for 3 minutes and OFF for 5 min,
I have three items in OH. which get updated by the Arduino sending ON, OFF and a heartbeat message via MQTT to OH.
The three notifications are processed by almost identical rules, which differ in action.
Such a rule looks like this:
if (ut_notification.state.toString == "ON")
{
ut_last_on.postUpdate(new DateTimeType())
ut_alarm_too_long_on.postUpdate(OFF)
// blue
Shed_KDL_Colour.sendCommand("220,100,30")
}
These rules work.
The relevant items are:
… each of which have an expire timer of 9 minutes for ON|OFF and 11 minutes for the heartbeat (which occurs every 10 min).
The expire functions (if not triggered) will send an ON command, which triggers a rule, like the following
rule "UT Alarm: ON state duration exceeded"
when
Item ut_alarm_too_long_on changed to ON
then
// red
Shed_KDL_Colour.sendCommand("10,100,30")
logInfo(LOG_PREFIX + "02.01", "Alarm red triggered by ut_alarm_too_long_on")
end
The MQTT log shows precise ON and OFF events, as well as the heartbeat,
2023-01-31 18:18:18.611 UniversalTimer|INFO|DHCP OK
2023-01-31 18:18:19.235 ON
2023-01-31 18:21:19.309 OFF
2023-01-31 18:26:19.431 ON
2023-01-31 18:28:18.856 UniversalTimer|INFO|DHCP OK
2023-01-31 18:29:19.505 OFF
2023-01-31 18:34:19.627 ON
2023-01-31 18:37:19.702 OFF
2023-01-31 18:38:19.099 UniversalTimer|INFO|DHCP OK
2023-01-31 18:42:19.822 ON
2023-01-31 18:45:19.897 OFF
2023-01-31 18:48:19.341 UniversalTimer|INFO|DHCP OK
2023-01-31 18:50:20.019 ON
2023-01-31 18:53:20.095 OFF
2023-01-31 18:58:19.588 UniversalTimer|INFO|DHCP OK
2023-01-31 18:58:20.217 ON
2023-01-31 19:01:20.293 OFF
2023-01-31 19:06:20.414 ON
2023-01-31 19:08:19.832 UniversalTimer|INFO|DHCP OK
So far so good; all working as designed
The problem is, OH, every now and then, issues an alert, despite the events occurring within the expire time setting.
Here the OH log:
2023-01-31 18:29:18.684 [INFO ] [re.model.script.UniversalTimer.04.01] - Alarm red triggered by ut_alarm_no_heartbeat
2023-01-31 18:37:19.861 [INFO ] [re.model.script.UniversalTimer.02.01] - Alarm red triggered by ut_alarm_too_long_on
And for convenience, the logs together in sequence:
2023-01-31 18:18:18.611 UniversalTimer|INFO|DHCP OK
2023-01-31 18:18:19.235 ON
2023-01-31 18:21:19.309 OFF
2023-01-31 18:26:19.431 ON
2023-01-31 18:28:18.856 UniversalTimer|INFO|DHCP OK
2023-01-31 18:29:18.684 [INFO ] [re.model.script.UniversalTimer.04.01] - Alarm red triggered by ut_alarm_no_heartbeat
2023-01-31 18:29:19.505 OFF
2023-01-31 18:34:19.627 ON
2023-01-31 18:37:19.702 OFF
2023-01-31 18:37:19.861 [INFO ] [re.model.script.UniversalTimer.02.01] - Alarm red triggered by ut_alarm_too_long_on
2023-01-31 18:38:19.099 UniversalTimer|INFO|DHCP OK
2023-01-31 18:42:19.822 ON
2023-01-31 18:45:19.897 OFF
2023-01-31 18:48:19.341 UniversalTimer|INFO|DHCP OK
2023-01-31 18:50:20.019 ON
2023-01-31 18:53:20.095 OFF
2023-01-31 18:58:19.588 UniversalTimer|INFO|DHCP OK
2023-01-31 18:58:20.217 ON
2023-01-31 19:01:20.293 OFF
2023-01-31 19:06:20.414 ON
2023-01-31 19:08:19.832 UniversalTimer|INFO|DHCP OK
I have no idea how to fix this?
Nor have I found this to be a known issue with the expire function.
Any hints appreciated.