[SOLVED] How to be informed about zwave COMMUNICATION_ERROR

Hi,
during the last days I experienced some problems with one of my zwave things. I only spotted this hours later and asked myself if there exists something that could automatically inform me (e.g. via mail or pushover) about this kind of circumstances.

The COMMUNICATION_ERROR has been reported in events.log. BTW: Why not in openhab.log?

I know that I could create a rule that checks the state of my zwave things from time to time and send a mail if something goes wrong. But as time based rules are instable since OH 2.2.0 (see https://github.com/eclipse/smarthome/issues/4130) I do not want to go this way. Does anybody know a better way?

Best regards,
Frank

Hi Frank,

use Thing based triggers.

See:

I tested it with the rule below. The log shows the following information without the rule:

rule "zwave_thing_test"
when Thing "zwave:device:c1f45758:node45" changed
// to “OFFLINE (COMMUNICATION_ERROR)“

then
val String thingUID = "zwave:device:c1f45758:node45"
var thingStatusInfo = getThingStatusInfo(thingUID)

// && (thingStatusInfo.getStatus().toString() == "ONLINE")) {

	if (thingStatusInfo !== null) {
	    logError("", "Thing status: " + thingStatusInfo.getStatus().toString() )
	} else {
	    logError("", "The thing \""+ thingUID + "\" doesn't exist.")
	}

End

The log result with the rule looks like this:

I hope this helps.

Regards
Norbert

1 Like

Hi Norbert,

great! That’s what I was looking for. I should have rtfm :wink:

Regards
Frank