Received event, but device doesn't change its state

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
User avatar
aLiEnHeAd
Posts: 50
Joined: 02 Feb 2017 15:09

Received event, but device doesn't change its state

Post by aLiEnHeAd » 12 Apr 2018 22:35

Hi!
I have a Neo Coolcam Door/Window sensor that sometimes does not change its state to "closed".
I analyzed the z-way-server log an noticed that I got an event, but the device doesn't change its state.
Here it worked:

Code: Select all

[2018-04-12 17:05:40.550] [D] [zway] RECEIVED: ( 01 11 00 04 00 21 09 71 05 00 00 00 FF 06 17 00 C1 00 99 )
[2018-04-12 17:05:40.551] [D] [zway] SENT ACK
[2018-04-12 17:05:40.551] [D] [zway] SETDATA devices.33.data.lastReceived = 0 (0x00000000)
[2018-04-12 17:05:40.552] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6.eventParameters = byte[0]
[2018-04-12 17:05:40.552] [D] [zway]   ( zero-length buffer )
[2018-04-12 17:05:40.552] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6.event = 23 (0x00000017)
[2018-04-12 17:05:40.559] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6.eventString = "Window/door is closed"
[2018-04-12 17:05:40.561] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6.status = 255 (0x000000ff)
[2018-04-12 17:05:40.561] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6 = Empty
[2018-04-12 17:05:40.643] [D] [zway] RECEIVED: ( 01 0C 00 04 00 21 04 30 03 00 0A C1 00 2A )
[2018-04-12 17:05:40.643] [D] [zway] SENT ACK
[2018-04-12 17:05:40.644] [D] [zway] SETDATA devices.33.data.lastReceived = 0 (0x00000000)
[2018-04-12 17:05:40.644] [D] [zway] SETDATA devices.33.instances.0.commandClasses.48.data.10.level = False
[2018-04-12 17:05:40.645] [D] [zway] SETDATA devices.33.instances.0.commandClasses.48.data.10 = Empty
[2018-04-12 17:05:40.660] [I] [core] (Mobile App Support) Notify listener (NotificationUpdate)
[2018-04-12 17:05:40.667] [I] [core] Notification: device-info (device-OnOff): {"dev":"Door/Window Sensor (#33)","l":"off","location":8}
[2018-04-12 17:05:40.671] [I] [core] (Mobile App Support) Notify listener (DeviceUpdate): Door/Window Sensor (#33) - off
[2018-04-12 17:05:40.915] [I] [core] [BaseModule-25] Set lastLevel to off for ZWayVDev_zway_33-0-48-10 (was on)
Zniffer:

Code: Select all

 
12.04.2018	17:05:40	33	1	-	-63 dBm	-	-	Sensor Binary Report (00, 0A)	 
12.04.2018	17:05:40	33	1	-	-63 dBm	-	-	Notification Report (00, 00, 00, FF, 06, 17, 00)
And here is the log where it didn't work:

Code: Select all

[2018-04-12 19:05:37.765] [D] [zway] RECEIVED: ( 01 11 00 04 00 21 09 71 05 00 00 00 FF 06 17 00 C3 00 9B )
[2018-04-12 19:05:37.765] [D] [zway] SENT ACK
[2018-04-12 19:05:37.766] [D] [zway] SETDATA devices.33.data.lastReceived = 0 (0x00000000)
[2018-04-12 19:05:37.766] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6.eventParameters = byte[0]
[2018-04-12 19:05:37.766] [D] [zway]   ( zero-length buffer )
[2018-04-12 19:05:37.766] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6.event = 23 (0x00000017)
[2018-04-12 19:05:37.774] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6.eventString = "Window/door is closed"
[2018-04-12 19:05:37.775] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6.status = 255 (0x000000ff)
[2018-04-12 19:05:37.775] [D] [zway] SETDATA devices.33.instances.0.commandClasses.113.data.6 = Empty
Zniffer:

Code: Select all

12.04.2018	19:05:37	33	1	-	-61 dBm	-	-	Notification Report (00, 00, 00, FF, 06, 17, 00)

As you can see, both times I get the event '23' but sometimes I don't get the "Sensor Binary Report" and the device doesn't change its state to 'off'.
Is there a way I could force the state of the device to off, after the event '23' was received ?
Or can I make some kind of virtual switch I can set after receiving event '23'?
Thanks a lot :)

User avatar
aLiEnHeAd
Posts: 50
Joined: 02 Feb 2017 15:09

Re: Received event, but device doesn't change its state

Post by aLiEnHeAd » 13 Apr 2018 23:53

I now used the custom JS-App to bind to the event:

Code: Select all

 
 zway.devices[33].instances[0].commandClasses[113].data[6].event.bind(
   function(){
     if(this.value==23){
       dev = this.controller.devices.get('ZWayVDev_zway_33-0-48-10'); 
       dev.set("metrics:level","off");
    }
  }
 )
 

I did not test it yet, but it may work 8-)

User avatar
aLiEnHeAd
Posts: 50
Joined: 02 Feb 2017 15:09

Re: Received event, but device doesn't change its state

Post by aLiEnHeAd » 19 Apr 2018 00:09

Mh.. now I get

Code: Select all

[2018-04-18 23:00:31.379] [E] [core] Callback execution err
r: TypeError: Cannot read property 'devices' of undefined
    at ZDataHolder.<anonymous> (<anonymous>:4:26)
What did I do wrong?
How can I access my VDev? :?


edit: damn.. I'm in my callback function so I think I have to change "this.controller.devices.get" to "zway.controller.devices.get"

Post Reply