How to catch "Thing 'zwave:device:xxx:node3' has been updated." in rule

Two things.

  1. I believe you want to reference the Item not Thing.

  2. You can also try changed for your when trigger.

The following works for me.

rule "Reset Garage States"

when

   Item Door_Garage changed or
   System started

then

Hmm… I don’t think so…

https://docs.openhab.org/configuration/rules-dsl.html#thing-based-triggers

Well then maybe his “thing” didn’t receive an update.

Thank you all for the hints.

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.

Channel 'astro:sun:home:set#event' triggered START

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.

This works for me (for online/offline state):

when 
	Thing "zwave:device:15ca6a108b9:node26" changed
then

If you need to catch rules errors, take a look at:

And with LogReader you can catch what ever you want from different logs. And of course filter out anything unwanted.

Thanks for all your additional hints.

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 come back to my old post.

In the doc of OH - rule - trigger there is a hint what to do:

Thing <thingUID> received update [<status>]
For example, one z-wave device can be "zwave:device:c5155aa4:node14"

But this is not working. Is this a bug?

No, it is still working fine like I described above:

Full rule:

rule "zwave node 26"
	when 
		Thing "zwave:device:uzb:node26" changed
	then
		var status = ThingAction.getThingStatusInfo("zwave:device:uzb:node26").getStatus()
		//logError("Debug", "Library Rules | " + status)
		
		if (status.toString()=='OFFLINE')
		{
			//logError("Debug", "Attempting to turn off light")
			logInfo("EXTRA","ON_OFFLINE: node 26 offline")			
		}
		else {
			logInfo("EXTRA","ON_OFFLINE: node 26 online")	
		}
end

Thanks, is it working for update too?

Thing "zwave:device:xxx:node3" received update

instead of

Thing "zwave:device:uzb:node26" changed

Just try it :rofl:

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.

You could set an timestamp for the update. I had some help last night doing this.
In this way I can tell from an “virtuel” item, when an action (ie item, could be channel as well I guess) has updated. I suspect you could set a state insted of a date/time for this “virtuel” item…
Anyway, have a look at this:

That is very uncommon. I have a lot of different brands (Fibaro, Everspring, D-Link, …) which all send proper updates, even the cheap ones from Shenzen Neo.
Also note that you can switch a lot of devices from Switch Binary to Notification Reports which may help.
Do you have a link to the database for one of those devices?

I would suspect they have to trigger in some way, before they´ll send update, specially if they´re motion sensors.
Temperatur, humidity, lumiance etc will send an update either in a specific time or a from threshold, both are part of the z-wave device configuration.

The binding will normally poll channels every 30 minutes (unless this is changed), so it’s unclear why this should be needed?

Hi chris,
I just want to know via a rule, if the device is still there. I use a lot of door/window sensors. One of my windows is not so often opened. Therefore no report was send due to open/close of the window. All my other sensors send a battery update every 4h. Only this type not.

I have a rule which catches this battery update and sets a last_update Item corresponsing to it. This works perfect. But not for this one z-wave device (Aeon Labs). It sends battery updates only if battery value is changed. If nothing happen, the device is silent and I do not know if it is still alive.

Yes I can take a lock at habmin to know if it is already there but this will not help my rule. In the log I see the update message from that device, but my rule did not trigger.