Motion sensor not updating

Hello,

I Have a motionsensor which is not updating. I have this sensor allready some time and wasn’t recognised in the older openhab version. After a few updates back it was recognised by the zwave binding, but I could not get it to work. I did some troubleshooting today and I can see in the log that zwavebinding is trying to update something, but it is not seen in the paperUI control section. I allready tried to link several different items but can’t get it to work. At last I made a rule to log something, but this rule is also not triggered.

I also tried to delete the thing and let it discover again, log part also included.

The rule:
rule test123
when Channel “zwave:device:512:node21:alarm_motion” triggered
then
logInfo(“Zwave”,“Test bewegings sensor”)
end

The log file (relevant part’s i think):
2020-09-22 20:08:37.573 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Handler disposed. Unregistering listener.
2020-09-22 20:08:37.594 [DEBUG] [l.initialization.ZWaveNodeSerializer] - NODE 21: Serializing to file /var/lib/openhab2/zwave/network_d2ec57a9__node_21.xml
2020-09-22 20:09:13.102 [DEBUG] [wave.discovery.ZWaveDiscoveryService] - NODE 21: Device discovery completed
2020-09-22 20:09:13.103 [DEBUG] [wave.discovery.ZWaveDiscoveryService] - NODE 21: Device discovery resolved to thingType zwave:hank_hkzwms02_00_000
2020-09-22 20:09:31.538 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Controller status changed to ONLINE.
2020-09-22 20:09:31.538 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Controller is ONLINE. Starting device initialisation.
2020-09-22 20:09:31.541 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Updating node properties.
2020-09-22 20:09:31.543 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Updating node properties. MAN=520
2020-09-22 20:09:31.543 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Updating node properties. MAN=520. SET. Was 520
2020-09-22 20:09:31.543 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Properties synchronised
2020-09-22 20:09:31.546 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Update ASSOCIATION group_ZWaveAssociationGroup [index=1, name=Lifeline, profile1=0, profile2=1, associations=[node_1]]: Adding Controller (node_1)
2020-09-22 20:09:31.546 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Update ASSOCIATION group_ZWaveAssociationGroup [index=2, name=On/Off control, profile1=32, profile2=1, associations=[node_1]]: Adding Controller (node_1)
2020-09-22 20:09:31.547 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Configuration synchronised
2020-09-22 20:09:31.550 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Initialising Thing Node…
2020-09-22 20:09:31.550 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Initialising cmd channel zwave:device:512:node21:alarm_motion for OnOffType
2020-09-22 20:09:31.550 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Initialising state channel zwave:device:512:node21:alarm_motion for OnOffType
2020-09-22 20:09:31.551 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Initialising state channel zwave:device:512:node21:alarm_motion for OnOffType
2020-09-22 20:09:31.551 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Initialising cmd channel zwave:device:512:node21:battery-level for PercentType
2020-09-22 20:09:31.551 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Initialising state channel zwave:device:512:node21:battery-level for PercentType
2020-09-22 20:09:31.552 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Polling initialised at 1800 seconds - start in 541800 milliseconds.
2020-09-22 20:09:31.552 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Device initialisation complete.

when motion detected (on or of, in this case off)

2020-09-22 20:44:55.145 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 21: Application Command Request (ALIVE:DONE)
2020-09-22 20:44:55.145 [DEBUG] [ng.zwave.internal.protocol.ZWaveNode] - NODE 21: resetResendCount initComplete=true isDead=false
2020-09-22 20:44:55.146 [DEBUG] [ng.zwave.internal.protocol.ZWaveNode] - NODE 21: Incoming command class COMMAND_CLASS_ALARM, endpoint 0
2020-09-22 20:44:55.146 [DEBUG] [ng.zwave.internal.protocol.ZWaveNode] - NODE 21: SECURITY NOT required on COMMAND_CLASS_ALARM
2020-09-22 20:44:55.146 [DEBUG] [tocol.commandclass.ZWaveCommandClass] - NODE 21: Received COMMAND_CLASS_ALARM V5 NOTIFICATION_REPORT
2020-09-22 20:44:55.146 [DEBUG] [.commandclass.ZWaveAlarmCommandClass] - NODE 21: NOTIFICATION report - 0 = 0, event=0, status=255, plen=1
2020-09-22 20:44:55.147 [DEBUG] [.commandclass.ZWaveAlarmCommandClass] - NODE 21: Alarm Type = BURGLAR (0)
2020-09-22 20:44:55.147 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Got an event from Z-Wave network: ZWaveAlarmValueEvent
2020-09-22 20:44:55.147 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Got a value event from Z-Wave network, endpoint=0, command class=COMMAND_CLASS_ALARM, value=255
2020-09-22 20:44:55.147 [DEBUG] [ternal.converter.ZWaveAlarmConverter] - NODE 21: Alarm converter processing NOTIFICATION
2020-09-22 20:44:55.148 [DEBUG] [ternal.converter.ZWaveAlarmConverter] - NODE 21: Alarm converter NOTIFICATION event is 0, type OnOffType
2020-09-22 20:44:55.148 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 21: Updating channel state zwave:device:512:node21:alarm_motion to OFF [OnOffType]
2020-09-22 20:44:55.148 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 21: Commands processed 1.
2020-09-22 20:44:55.149 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 21: Checking command org.openhab.binding.zwave.internal.protocol.ZWaveCommandClassPayload@17c9785b.

I’m running openhab version:
openHAB 2.5.9 Release Build

Thanks in advance,

Peter.

Perhaps the log viewer can help .

But …

The channel is not an event channel, it never gets triggered.

It is a state channel, you must link it to an Item.

Then you trigger a rule from Item update or change as you wish.

1 Like

Thanks for your replies, I didn’t realize there is a difference between event and state channels. At first I created and linked items from the paperUI just like other zwave motion sensors, but state is not ‘transfered’ to the control section in the PaperUI.

I made a new item (again) and a new rule based on an item, and the rule is executed. Thanks again.

I started out with the control section in the paperUI, and this is still not updated. This is not a big problem. For me the rule was most important. I included a screenshot of the PaperUI

Thanks.!
PaperUI|690x154

1 Like

What are you expecting to see i.e. what kind of Item are we talking about, what [state presentation] (if any) are you using with that? What states is it taking up, as shown in your events.log?

Astro binding provides good examples of this.
A sunrise state channel might give 06:30. That’s a static state, the linked Item will be 06:30 all day long.
A sunrise event channel however will trigger START at 06:29 and trigger END at 06:31 or something like. The rest of the time, it is just void.
They’re not interchangeable at all, as you can see.

Thanks for your reply,

The channel event vs state is clear to me now.

You ask me what I expect to see on the control section of the paper iu? I’m used to see ‘results’ of items linked to channel of things. So I excpected an on/off or motion/no motion, something like that. Now that I look at my other motion sensors (zwave) I see none of them reports it’s state in the control section. I’m not sure if this was always like this or that this changed after an update. Again, this is not a problem for me. so all is solved concernig me. If you think this is not normal and you want to now more, I can give more info.

Regards,

Peter.

That’s fair enough.
How about -

Additionally - how did you link your Item, by PaperUI or defining in xxx.items file? I ask because from file you can force fit square pegs (of Item type) into round holes (channel type) and not get the results you expect.

First, thanks for your effort to help, all your input is appreciated.

I do allmost all configuration from paperUI, except for rules. So I created the item from linking the channel by ‘create new’. When I created this item I used all defaults. It created an Item of type Switch and catagory Motion. I’m not sure what you mean by [state presentation]

During my troubleshooting I also found this content in json files, I do no editing by hand, all is created from paperUI;

/var/lib/openhab2/jsondb/org.eclipse.smarthome.core.items.Item.json

“ZWaveNode021HKZW_MS02MotionSensor_MotionAlarm”: {
“class”: “org.eclipse.smarthome.core.items.ManagedItemProvider$PersistedItem”,
“value”: {
“groupNames”: [],
“itemType”: “Switch”,
“tags”: [],
“label”: “Motion Alarm”,
“category”: “Motion”
}
},

/var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.link.ItemChannelLink.json

“ZWaveNode021HKZW_MS02MotionSensor_MotionAlarm -\u003e zwave:device:512:node21:alarm_motion”: {
“class”: “org.eclipse.smarthome.core.thing.link.ItemChannelLink”,
“value”: {
“channelUID”: {
“segments”: [
“zwave”,
“device”,
“512”,
“node21”,
“alarm_motion”
]
},
“configuration”: {
“properties”: {
“profile”: “system:default”
}
},
“itemName”: “ZWaveNode021HKZW_MS02MotionSensor_MotionAlarm”
}
},

/var/lib/openhab2/jsondb/org.eclipse.smarthome.core.thing.Thing.json

“zwave:device:512:node21”: {
“class”: “org.eclipse.smarthome.core.thing.internal.ThingImpl”,
“value”: {
“label”: “Z-Wave Node 021: HKZW_MS02 Motion Sensor”,
“bridgeUID”: {
“segments”: [
“zwave”,
“serial_zstick”,
“512”
]
},
“channels”: [
{
“acceptedItemType”: “Switch”,
“kind”: “STATE”,
“uid”: {
“segments”: [
“zwave”,
“device”,
“512”,
“node21”,
“alarm_motion”
]
},
“channelTypeUID”: {
“segments”: [
“zwave”,
“alarm_motion”
]
},
“label”: “Motion Alarm”,
“description”: “Indicates if a motion alarm is triggered”,
“configuration”: {
“properties”: {}
},
“properties”: {
“binding::OnOffType": “COMMAND_CLASS_ALARM,COMMAND_CLASS_BASIC;type\u003dBURGLAR”
},
“defaultTags”: []
},
{
“acceptedItemType”: “Number”,
“kind”: “STATE”,
“uid”: {
“segments”: [
“zwave”,
“device”,
“512”,
“node21”,
“battery-level”
]
},
“channelTypeUID”: {
“segments”: [
“system”,
“battery-level”
]
},
“label”: “Battery Level”,
“configuration”: {
“properties”: {}
},
“properties”: {
"binding:
:PercentType”: “COMMAND_CLASS_BATTERY”
},
“defaultTags”: []
}
]

I’m not sure if this is the way to post (all text), and hope you have your answers?

Regards,

Peter.

Fair enough.

Still missing -

If you have not looked in your events.log before, it is a really useful resource to see what is going on.

JSON is helpful as far as it goes, but it’s ‘history’ in a way. You can see the ‘live’ condition of Items, links, etc. (also in JSON form) using the REST API. Install oddly named “REST API Docs” for a useful interactive tool.

That looks a bit weird. I don’t know if unicode in there is normal.

1 Like

Code fences make things clearer.
How to use code fences - Tutorials & Examples - openHAB Community

OK, didn’t know about this file, indeed very usefull. I looked up the sensor:

2020-09-24 23:55:39.038 [vent.ItemStateChangedEvent] - ZWaveNode021HKZW_MS02MotionSensor_MotionAlarm changed from ON to OFF
2020-09-24 23:55:58.698 [vent.ItemStateChangedEvent] - ZWaveNode021HKZW_MS02MotionSensor_MotionAlarm changed from OFF to ON

I see that code at every Thing defined, so seems OK.

Best regards,

Peter.

so it is working, my motion sensors which are items of type ‘switch’ do NOT update in Paper UI either. Don’t use the Paper UI for checking the status of your motion sensor switch items.

no, try something like

rule "test123"
when Item ZWaveNode021HKZW_MS02MotionSensor_MotionAlarm changed
then
logInfo(“Zwave”,“Test bewegings sensor”)
end

edit for stupid rule mistake
read this stuff

1 Like

Job done.

It’s a part of the Item label
"my text label [%s]"
and the [part]controls how the state of the Item is presented in a UI. %s for string in this case, so you’d expect to see text for state.

zwave binding does some clever things with Item presentation defaults, these show up as “options” in the Item REST JSON and I suspect that it is suppressing the usual PaperUI toggle for a Switch type, because this is a read-only switch - you cannot control it. I further suspect that if you ask for a [state presentation] you might get one.
PaperUI does not make it clear that you can use in labels.

Despite your troubles with PaperUI I think this will work fine in a proper UI.

1 Like

@Andrew_Rowe, I allready mentioned in my second post that the rule was working, and I won’t use PaperUI for status checking anymore. Thanks,

@rossko57, Thanks, I guess I have to make customizations in item files to see results in PaperUI. No problem, I’ve got hte event.log file now (how could I miss that!). I know about the Rest API Doc… I used it to add tags to items.

No. You can edit Items with PaperUI.

Remember that PaperUI is an administrator’s toolbox. It’s not supposed to support decorative displays etc., and it has shortcomings when faced with that kind of configuration.

There are user-facing UIs for that.