[SOLVED]how do I find out what to "bind" to?

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
doubledrat
Posts: 17
Joined: 25 Nov 2018 13:57

[SOLVED]how do I find out what to "bind" to?

Post by doubledrat »

Hi

I hope this is an easy question but I've failed to find the answer for myself after 3 hours!

I have a new device (a fibaro motion sensor) and I would like to execute a script when it detects motion.

I already have a script being triggered by another device, so I know the mechanics of doing this, but how do I find out the magic string that I bind to?!

thanks in advance
Last edited by doubledrat on 26 Jul 2020 12:15, edited 1 time in total.
User avatar
PoltoS
Posts: 7624
Joined: 26 Jan 2011 19:36

Re: how do I find out what to "bind" to?

Post by PoltoS »

Depends on the API. On low level it should be something like zway.devices[X].SensorBinary.data[8].val.bind(FUNCTION).

Check the manual
doubledrat
Posts: 17
Joined: 25 Nov 2018 13:57

Re: how do I find out what to "bind" to?

Post by doubledrat »

for others (and myself when I need to do this again!) this is how I found it

in /var/log/z-way-server.log there is the following

Code: Select all

[2020-07-26 10:03:32.466] [D] [zway] SETDATA devices.4.instances.0.commandClasses.113.data.7.event = 8 (0x00000008)
[2020-07-26 10:03:32.477] [D] [zway] SETDATA devices.4.instances.0.commandClasses.113.data.7.eventString = "Motion detected, location unknown"
[2020-07-26 10:03:32.477] [D] [zway] SETDATA devices.4.instances.0.commandClasses.113.data.7.status = 255 (0x000000ff)
[2020-07-26 10:03:32.478] [D] [zway] SETDATA devices.4.instances.0.commandClasses.113.data.7 = Empty
[2020-07-26 10:03:40.458] [I] [core] (Mobile App Support) send notification: "Fibaro Motion Sensor (#4) : on"
that translated to

Code: Select all

zway.devices[4].instances[0].commandClasses[113].data[7].status.bind(function () {
in main.js
Post Reply