Skip to content
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

begin_command_add_device() integer is required #196

Open
isfandyar01 opened this issue Feb 1, 2020 · 0 comments
Open

begin_command_add_device() integer is required #196

isfandyar01 opened this issue Feb 1, 2020 · 0 comments

Comments

@isfandyar01
Copy link

i am trying to put my device in inclusion mode to add door switch and this is my code

import logging
import sys, os
import resource
#logging.getLogger('openzwave').addHandler(logging.NullHandler())
#logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.INFO)

logger = logging.getLogger('openzwave')
import openzwave
from openzwave.node import ZWaveNode
from openzwave.value import ZWaveValue
from openzwave.scene import ZWaveScene
from openzwave.controller import ZWaveController
from openzwave.network import ZWaveNetwork
from openzwave.option import ZWaveOption
import time
import six
if six.PY3:
from pydispatch import dispatcher
else:
from louie import dispatcher

device="/dev/ttyACM0"
log="None"

for arg in sys.argv:
if arg.startswith("--device"):
temp,device = arg.split("=")
elif arg.startswith("--log"):
temp,log = arg.split("=")
elif arg.startswith("--help"):
print("help : ")
print(" --device=/dev/yourdevice ")
print(" --log=Info|Debug")

options = ZWaveOption(device,
config_path="/usr/local/lib/python2.7/dist-packages/python_openzwave/ozw_config/",
user_path=".", cmd_line="")
options.set_log_file("OZW_Log.log")
options.set_append_log_file(False)
options.set_console_output(True)
options.set_save_log_level(log)
#options.set_save_log_level('Info')
options.set_logging(False)
options.lock()

network = ZWaveNetwork(options, log=None)

controller=ZWaveController(None,network)
controller.begin_command_add_device()
##controller.cancel_command()
##if(controller.begin_command_add_device()==True):

print "device in inclusion mode"

This the error i get

Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license()" for more information.

===================== RESTART: /home/pi/zwave python.py =====================
INFO:openzwave:Start Openzwave network.

Warning (from warnings module):
File "/home/pi/zwave python.py", line 51
controller.begin_command_add_device()
DeprecationWarning: Call to deprecated function begin_command_add_device.

Traceback (most recent call last):
File "/home/pi/zwave python.py", line 51, in
controller.begin_command_add_device()
File "/usr/local/lib/python2.7/dist-packages/openzwave/object.py", line 48, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/openzwave/controller.py", line 1148, in begin_command_add_device
self.CMD_ADDDEVICE, self.zwcallback, highPower=high_power)
File "src-lib/libopenzwave/libopenzwave.pyx", line 4207, in libopenzwave.PyManager.beginControllerCommand
TypeError: an integer is required

INFO:openzwave:Driver ready using library Static Controller version Z-Wave 6.02
INFO:openzwave:home_id 0xe3140147, controller node id is 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant