I have some experience with OH and most of what you told me I’ve tested before open this post.
What I want to do:
I need an information which of my 70 z-wave devices do no longer report anything. For mostly all of them I created a group and a rule to trigger about reporting battery state. If there is no update within 3 days I get an message to care about the device. Only one manifactor does not report battery updates in a reliable time slot. But in the z-wave log I see this “Thing ‘zwave:device:xxx:node3’ has been updated” for this devcies
So I thought that for only this devices I create dedicated rules to update timestamp of last seen by this trigger. But I never get this rule to work. I see it in the log but rule keeps silent. I tried “changed” too. But there is not change on the thing. Only if it will change from ONLINE to OFFLINE, But this will happen only on startup of OH.
If I compare it with my astro rules. the syntax should be correct. But it is a Channel not a Thing in that case.
And a second thing I discovered, triggeringItem is not available for this kind of rule. It is clear because there is no underlying Item related to. I have to create a rule for every of this devices.
As an workaround, you could try monitoring events.log from a shell script and, when a line with the pattern you want is found, trigger an update of an item with rest api.
That is, if you’re using Linux… Doable in Windows also, but more complicated.
The log says nothing special what is wrong. No rule error is here.
Due to that the state is not chaned the rule tirgger “changed” is not working. I will try to implemnt the work around and monitor the event.log from a script.
I cannot try it, my things send only update notification, no change notification. I can see this in the log.
The question is, can you test it on your side. Because you have a running rule which is triggered by change and have a device which causes this. The update rule should be triggered too. If this is working on your side, I know that something is wrong on my side.
My z-wave items send only update messages no change in the log. Therefore my rule “changed” will never triggered.
I get no update events on the nodes, but changed events on openHAB restart.
So I guess you need to find something else for your usecase.
Do you only need this for number items? I’m using an expire binding function and a group for some of my temperature devices which works pretty well:
Group:Number:OR(UNDEF,NULL) gCheckSensorStates
Number Temperature (gCheckSensorStates) { mqtt="<[mosquitto:/esp8266three/temperature/rainwater:state:default]",expire="60m" }
rule "check sensor state"
when
Item gCheckSensorStates changed
then
if (gCheckSensorStates.state==UNDEF) {
val triggerItem = gCheckSensorStates.members.filter[ i|i.state==UNDEF ]
logInfo("EXTRA","No more data from: "+triggerItem)
}
end
I have some z-wave devices which do not send any updates without a trigger. For them I search for something to know if they are connected/active and not dead.
Most of my devices send a battery update within 4 hours. I catch thsi and update the corresponding last_update item. Some not. But I see
Thing 'zwave:device:xxx:node3' has been updated.
in the log for them. I tried to catch this message and update the last_update state of these device.