ZWay: notification on event
Having now my sensors now installed "properly" (well, the sensors are hell to mount on PVC) on the door and windows at home, it is time to set-up my little ZWay application to get notified when these sensors are generating some events. More precisely, when a window or door gets open...
The ZWay API provides the possibility to install some callbacks when "data holder" are changed. Therefore the first thing to investigate is the data holder.
There are a few functions to get a hand on a data holder:
ZDataHolder dataHolder = zway_find_device_instance_cc_data(theZWay, 2, 0, 48, "");
version=1
security=False
interviewDone=True
interviewCounter=9
level=True
Data change type 129
version=1
security=False
interviewDone=True
interviewCounter=9
level=False
The ZWay API provides the possibility to install some callbacks when "data holder" are changed. Therefore the first thing to investigate is the data holder.
There are a few functions to get a hand on a data holder:
- zway_find_data(...)
That one requires a data holder as argument, so that's not the one we need.
- zway_find_controller_data
- zway_find_device_data
- zway_find_device_instance_data
- zway_find_device_instance_cc_data
ZDataHolder dataHolder = zway_find_device_instance_cc_data(theZWay, 2, 0, 48, "");
Given a bit of code to display a data holder in the callback, this will display the following when my sensor ID=2 instance=0 commandClass=48 (sensor binary) will be changed:Data change type 129
version=1
security=False
interviewDone=True
interviewCounter=9
level=True
Data change type 129
version=1
security=False
interviewDone=True
interviewCounter=9
level=False
Comments
Post a Comment