Hi, I experienced an odd behavior with a rule. Because I need to do a calculation of an item I created a (textual) rule. In principle the value is pretty static so I am using “received update” and not “changed”. As you can see I also update a timestamp to see if my MQTT from an Arduino UNO is still alive. I noticed this timestamp was not updated, The later added loginfo does not generate a “org.openhab.core.model.script.rule”. When I check with MQTT explorer everything on the Arduino side works and new topics are sent. I also tested a start/stop of openhab; this will activate the rule (including the loginfo)
My rule is:
rule "waterlevel"
when
//Time cron "0 0/5 * * * ?" or
//Thing "mqtt:topic:NAP" received update or
Item Cellar_pump received update
then
var Number vNAP = Cellar_pump.state as DecimalType
NAP_lastupdate.postUpdate(new DateTimeType())
vNAP = 360 - 196 + 55 - vNAP
if ( vNAP < 150 ) {
Cellar_pump_NAP.postUpdate(vNAP)
logInfo("RULE", "Received waterlevel value : " + vNAP)
} else {
logInfo("RULE", "Waterlevel value incorrect : " + vNAP)
}
end
What do I miss?
My details are:
Hardware: Intel NUC 7i3BNK - 12 Gb
system: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-60docker veerr-generic x86_64)
openhab/openhab:3.4.1 (on docker)
wj4nuc@nuc:~$ docker version
Client: Docker Engine - Community
Version: 20.10.23
API version: 1.41
Go version: go1.18.10
Git commit: 7155243
Built: Thu Jan 19 17:45:08 2023
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.23
API version: 1.41 (minimum version 1.12)
Go version: go1.18.10
Git commit: 6051f14
Built: Thu Jan 19 17:42:57 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.15
GitCommit: 5b842e528e99d4d4c1686467debf2bd4b88ecd86
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
# java -version
openjdk version "11.0.17" 2022-10-18
OpenJDK Runtime Environment Temurin-11.0.17+8 (build 11.0.17+8)
OpenJDK 64-Bit Server VM Temurin-11.0.17+8 (build 11.0.17+8, mixed mode)