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
[SOLVED]how do I find out what to "bind" to?
-
- Posts: 17
- Joined: 25 Nov 2018 13:57
[SOLVED]how do I find out what to "bind" to?
Last edited by doubledrat on 26 Jul 2020 12:15, edited 1 time in total.
Re: how do I find out what to "bind" to?
Depends on the API. On low level it should be something like zway.devices[X].SensorBinary.data[8].val.bind(FUNCTION).
Check the manual
Check the manual
-
- Posts: 17
- Joined: 25 Nov 2018 13:57
Re: how do I find out what to "bind" to?
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
that translated to
in main.js
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"
Code: Select all
zway.devices[4].instances[0].commandClasses[113].data[7].status.bind(function () {