-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish add_node / remove_node mode #6
Comments
You're right. There is actually no way to retrieve the command from notification. So actually you need to "save" the last sent command in a "flag". For me, it's not a good way to do it, that's why I don't implement it. Keep in mind in that user (in dynamic mode with .so modules) can launch an instance of a python program AND an instance of ozwcp for example. |
Thanks bibi, For me it´s more comfortable to execute one include command and throw away all other include commands in that time the chip is in include mode.(same for exclude command) . So I have to cancel only once the same command, otherweise the chip could be stuck in include mode all the time. And this state nobody wants to have ;) |
Hi,
I tried to distinguish if the controller is in add_node mode (also called include mode) or in remove_node mode (exclude mode).


In the debug logs from python-openzwave, it seems to be there is the same callback information for both function,
First picture shows the add_node, second the remove_node function
Here the relevant part:
add_node
DEBUG Z-Wave ControllerCommand : {'controllerState': 'Starting', 'controllerError': 'None', 'controllerErrorInt': 0, 'notificationType': 'ControllerCommand', 'nodeId': 0, 'controllerStateInt': 1, 'controllerErrorDoc': 'None.', 'homeId': 23197916L, 'controllerStateDoc': 'The command is starting.'}
DEBUG Z-Wave ControllerCommand : {'controllerState': 'Waiting', 'controllerError': 'None', 'controllerErrorInt': 0, 'notificationType': 'ControllerCommand', 'nodeId': 0, 'controllerStateInt': 4, 'controllerErrorDoc': 'None.', 'homeId': 23197916L, 'controllerStateDoc': 'Controller is waiting for a user action.'}
remove_node
DEBUG Z-Wave ControllerCommand : {'controllerState': 'Starting', 'controllerError': 'None', 'controllerErrorInt': 0, 'notificationType': 'ControllerCommand', 'nodeId': 0, 'controllerStateInt': 1, 'controllerErrorDoc': 'None.', 'homeId': 23197916L, 'controllerStateDoc': 'The command is starting.'}
DEBUG Z-Wave ControllerCommand : {'controllerState': 'Waiting', 'controllerError': 'None', 'controllerErrorInt': 0, 'notificationType': 'ControllerCommand', 'nodeId': 0, 'controllerStateInt': 4, 'controllerErrorDoc': 'None.', 'homeId': 23197916L, 'controllerStateDoc': 'Controller is waiting for a user action.'}
When you compare both picture, the callback is the same, so I don´t know in which mode the z-wave chip is.
In openzwave logs, there is some difference between add_node and remove_node function


Maybe there is another way to find out in python-openzwave in which mode the chip is, but I didn´t find it yet ;)
my system:
OS: Linux Mint 17 32 Bit
3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:31:42 UTC 2014 i686 i686 i686 GNU/Linux
python-openzwave commit: b4476e2
Python:
Python 2.7.6 (default, Mar 22 2014, 22:59:38) [GCC 4.8.2]
cython -V:
Cython version 0.20.1post0
HW:
Z-Wave Aeotec Z-Stick S2
The text was updated successfully, but these errors were encountered: