Giter VIP home page Giter VIP logo

python-openzwave's Introduction

Travis status Circle status Appveyor status Pypi format Documentation

python-openzwave

python-openzwave is a python wrapper for the openzwave c++ library : https://github.com/OpenZWave/open-zwave

  • full manager implementation with options
  • an API to map the ZWave network in Python objects
  • a command line manager to manage / debug your ZWave network
  • a full-event webapp example : flask + socket.io + jquery
  • a suite of tests
  • many examples
  • Full documentation

python-openzwave 0.4.x is here !!!

  • New installation process via pip

  • First, you need some build tools and libs. On ubuntu, you should use :

    sudo apt-get install --force-yes -y make libudev-dev g++ libyaml-dev
  • Make your virtualenv and activate it :

    virtualenv --python=python3 venv3
    source venv3/bin/activate
  • Install the default flavor :

    (venvX) pip install python_openzwave
  • The previous command try to install python_openzwave with the flavor 'shared'. If it can't find a precompiled library of openzwave, it will use the flavor 'embed' with sources downloaded from https://github.com/OpenZWave/python-openzwave/tree/master/archives. You can change this using flavor option. There is a bug in the package dependencies and flavors on some systems. You may need to install dependencies manualy :

  • on python 2.7 :

    (venvX) pip install cython wheel six pyserial
    (venvX) pip install 'Louie>=1.1'
  • on python 3 :

    (venvX) pip install cython wheel six pyserial
    (venvX) pip install 'PyDispatcher>=2.0.5'
  • Choose your flavor :

    • embed : the default one. Download sources from https://github.com/OpenZWave/python-openzwave/tree/master/archives and build them. Python_openzwave is statically build using a cythonized version of libopenzwave. No need to install cython.
    • shared : if you have install openzwave as module manually, you can link python_openzwave to it.
    • git : download sources from openzwave github and link statically to it.
    • embed_shared : download sources from https://github.com/OpenZWave/python-openzwave/tree/master/archives, build and install as module on the system. Python_openzwave use it. Need root access to install openzwave libs.
    • git_shared : download sources from openzwave github, build and install them as module on the system. Python_openzwave use it. Need root access to install openzwave libs.
    • ozwdev and ozwdev_shared : use the dev branch of openzwave on github.
    • dev : for python_openzwave developers. Look for openzwave sources in a local folder specified by the LOCAL_OPENZWAVE environment variable (defaults to 'openzwave').
  • Install it :

    (venvX) pip install python_openzwave  --no-deps --install-option="--flavor=git"
  • You can update to the last version of openzwave using the git flavor :

    (venvX) pip uninstall -y python_openzwave
    (venvX) pip install python_openzwave --no-cache-dir --no-deps --install-option="--flavor=git"
  • At last, you can launch pyozw_check to test your installation :

    If no usb stick is connected to the machine, launch :

    (venvX) pyozw_check

    If you've one, use it for advanced checks :

    (venvX) pyozw_check -i -d /dev/ttyUSB0
    -------------------------------------------------------------------------------
    Import libs
    Try to import libopenzwave
    Try to import libopenzwave.PyLogLevels
    Try to get options
    Try to get manager
    Try to get python_openzwave version
    0.4.0.27
    Try to get python_openzwave full version
    python-openzwave version 0.4.0.27 (dev / Apr 18 2017 - 23:22:26)
    Try to get openzwave version
    1.4.2501
    Try to get default config path
    /etc/openzwave/
    Try to import openzwave (API)
    -------------------------------------------------------------------------------
    Intialize device /dev/ttyUSB0
    Try to get options
    Try to get manager
    2017-04-12 16:41:29.329 Always, OpenZwave Version 1.4.2497 Starting Up
    Try to add watcher
    ...
    2017-04-12 16:44:05.880 Always, ***************************************************************************
    2017-04-12 16:44:05.880 Always, *********************  Cumulative Network Statistics  *********************
    2017-04-12 16:44:05.880 Always, *** General
    2017-04-12 16:44:05.880 Always, Driver run time: . .  . 0 days, 0 hours, 1 minutes
    2017-04-12 16:44:05.880 Always, Frames processed: . . . . . . . . . . . . . . . . . . . . 27
    2017-04-12 16:44:05.880 Always, Total messages successfully received: . . . . . . . . . . 27
    2017-04-12 16:44:05.880 Always, Total Messages successfully sent: . . . . . . . . . . . . 19
    2017-04-12 16:44:05.880 Always, ACKs received from controller:  . . . . . . . . . . . . . 19
    2017-04-12 16:44:05.880 Always, *** Errors
    2017-04-12 16:44:05.880 Always, Unsolicited messages received while waiting for ACK:  . . 0
    2017-04-12 16:44:05.880 Always, Reads aborted due to timeouts:  . . . . . . . . . . . . . 0
    2017-04-12 16:44:05.880 Always, Bad checksum errors:  . . . . . . . . . . . . . . . . . . 0
    2017-04-12 16:44:05.880 Always, CANs received from controller:  . . . . . . . . . . . . . 0
    2017-04-12 16:44:05.880 Always, NAKs received from controller:  . . . . . . . . . . . . . 0
    2017-04-12 16:44:05.880 Always, Out of frame data flow errors:  . . . . . . . . . . . . . 0
    2017-04-12 16:44:05.880 Always, Messages retransmitted: . . . . . . . . . . . . . . . . . 0
    2017-04-12 16:44:05.880 Always, Messages dropped and not delivered: . . . . . . . . . . . 0
    2017-04-12 16:44:05.880 Always, ***************************************************************************
    2017-04-12 16:44:07.887 Info, mgr,     Driver for controller /dev/ttyUSB0 removed
    Try to remove watcher
    Try to destroy manager
    Try to destroy options

    You can list the nodes on your network using :

    (venvX) pyozw_check -l -d /dev/ttyUSB0 -t 60
    -------------------------------------------------------------------------------
    Define options for device /dev/ttyUSB0
    Start network
    Wait for network (30s)
    Network is ready
    -------------------------------------------------------------------------------
    Controller capabilities : {'primaryController', 'staticUpdateController'}
    Controller node capabilities : {'listening', 'primaryController', 'staticUpdateController', 'beaming'}
    Nodes in network : 4
    Driver statistics : {'noack': 6, 'routedbusy': 0, 'readCnt': 115, 'ACKWaiting': 0, 'badChecksum': 0, 'broadcastReadCnt': 0, 'NAKCnt': 0, 'broadcastWriteCnt': 9, 'dropped': 0, 'CANCnt': 0, 'callbacks': 0, 'OOFCnt': 0, 'readAborts': 0, 'badroutes': 0, 'SOFCnt': 115, 'netbusy': 0, 'writeCnt': 49, 'nondelivery': 0, 'ACKCnt': 49, 'retries': 0}
    ------------------------------------------------------------
    1 - Name :  ( Location :  )
     1 - Ready : True / Awake : True / Failed : False
     1 - Manufacturer : Aeotec  ( id : 0x0086 )
     1 - Product : DSA02203 Z-Stick S2 ( id  : 0x0001 / type : 0x0002 )
     1 - Version : 3 / Secured : False / Zwave+ : False
     1 - Command classes : {'COMMAND_CLASS_NO_OPERATION', 'COMMAND_CLASS_BASIC'}
     1 - Capabilities : {'staticUpdateController', 'listening', 'primaryController', 'beaming'}
     1 - Neigbors : {4} / Power level : None
     1 - Is sleeping : False / Can wake-up : False / Battery level : None
    
    ...
    
    ------------------------------------------------------------
    4 - Name :  ( Location :  )
     4 - Ready : True / Awake : True / Failed : False
     4 - Manufacturer : GreenWave  ( id : 0x0099 )
     4 - Product : PowerNode 6 port ( id  : 0x0004 / type : 0x0003 )
     4 - Version : 4 / Secured : False / Zwave+ : False
     4 - Command classes : {'COMMAND_CLASS_BASIC', 'COMMAND_CLASS_CONFIGURATION', 'COMMAND_CLASS_SWITCH_BINARY', 'COMMAND_CLASS_VERSION', 'COMMAND_CLASS_CRC_16_ENCAP', 'COMMAND_CLASS_MANUFACTURER_SPECIFIC', 'COMMAND_CLASS_ASSOCIATION', 'COMMAND_CLASS_MULTI_INSTANCE/CHANNEL', 'COMMAND_CLASS_METER', 'COMMAND_CLASS_PROTECTION', 'COMMAND_CLASS_NO_OPERATION', 'COMMAND_CLASS_SWITCH_ALL'}
     4 - Capabilities : {'listening', 'routing', 'beaming'}
     4 - Neigbors : {1} / Power level : None
     4 - Is sleeping : False / Can wake-up : False / Battery level : None
    
     ...
  • The old manager is now available via the pyozw_shell command. You need to install module "urwid>=1.1.1" with pip before using it.

  • libopenzwave and openzwave python modules are packaged in the python_openzwave. So developers needs to update their install_requires (it works fine with pyozw_manager). They can use the following code to update softly :

    pyozw_version='0.4.1'
    
    def install_requires():
        try:
            import python_openzwave
            return ['python_openzwave==%s' % pyozw_version]
        except ImportError:
            pass
        try:
            import libopenzwave
            return ['openzwave==%s' % pyozw_version]
        except ImportError:
            pass
        return ['python_openzwave == %s' % pyozw_version]
  • If you already have an 0.3.x version installed, you should update your installation as usual. Don't install it with pip as it can break your installation (maybe not if you don't remove old modules)

  • Support for windows, macosx, ... is not tested. Feel free to report bug and patches. We can try to support these plateforms. Don't have Windows at home so I can't help. Same for mac.

  • Old installation process is deprecated and reserved for python-openzwave-developers and alternatives machines.

  • Please report your successful installations here : #73

Support

You can ask for support on the google group : http://groups.google.com/d/forum/python-openzwave-discuss.

Please don't ask for support in github issues or by email.

Pull requests

Please read DEVEL documentation before submitting pull request. A lot of project tasks are done automatically or with makefile, so they must be done in a certain place or in a special order.

python-openzwave's People

Contributors

b3nj1 avatar bibi21000 avatar cclauss avatar colinodell avatar cslarsen avatar dereisele avatar digdugg avatar dude0001 avatar durin42 avatar emil-e avatar emlove avatar hedrickbt avatar hoopty avatar jshwright avatar judgedreddklc avatar kdschlosser avatar lenardteri avatar martinayotte avatar mlambert-zotec avatar nechry avatar nico0084 avatar sylvaincherrier avatar techgaun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-openzwave's Issues

Group not support MultiInstanceAssociation

hi,

the manager.pxd

void AddAssociation(uint32_t homeid, uint8_t nodeid, uint8_t groupidx, uint8_t targetnodeid)

not fully implement the CC MultiInstanceAssociation. we can specify a instance of desired node target: https://github.com/OpenZWave/open-zwave/blob/1c64a40037bdb8207c0afa6bd10be8ac3d3327fd/cpp/src/Manager.h#L1564
https://github.com/OpenZWave/open-zwave/blob/f32e84b7ace5ae929153c1897f52a4c44b5cecd7/cpp/src/Group.h#L84

same for Remove methods.

Integration of Aeotec switch gen5 (Model ZW075-C16)

Hello,
i'm using a new zwave switch. The switch is integrated in my zwave network, and i get informations when i use api_demo.py. But this device is not recognized as a switch (get_switches() method says nothing)

here the result of get_switches() :

Nodes in network : 3
------------------------------------------------------------
Retrieve switches on the network
------------------------------------------------------------
------------------------------------------------------------
Retrieve dimmers on the network

here is the output of api_demo.py

4 - Name : 
4 - Manufacturer name / id : Unknown: id=0086 / 0x0086
4 - Product name / id / type : Unknown: type=0003, id=004b / 0x004b / 0x0003
4 - Version : 4
4 - Command classes : {'COMMAND_CLASS_HAIL', 'COMMAND_CLASS_DEVICE_RESET_LOCALLY', 'COMMAND_CLASS_NO_OPERATION', 'COMMAND_CLASS_ZWAVE_PLUS_INFO', 'COMMAND_CLASS_MANUFACTURER_SPECIFIC', 'COMMAND_CLASS_VERSION', 'COMMAND_CLASS_CRC_16_ENCAP'}
4 - Capabilities : {'beaming', 'listening', 'routing'}
4 - Neigbors : {1, 2}
4 - Can sleep : False
4 - Groups : {}
   ---------   
4 - Values for command class : COMMAND_CLASS_NO_OPERATION : {}
   ---------   
4 - Values for command class : COMMAND_CLASS_HAIL : {}
   ---------   
4 - Values for command class : COMMAND_CLASS_VERSION : {72057594119815191: {'readonly': True, 'max': 0, 'help': '', 'writeonly': False, 'label': 'Protocol Version', 'data_str': '3.83', 'min': 0, 'data': '3.83', 'ispolled': False, 'type': 'String', 'genre': 'System', 'units': ''}, 72057594119815207: {'readonly': True, 'max': 0, 'help': '', 'writeonly': False, 'label': 'Application Version', 'data_str': '3.26', 'min': 0, 'data': '3.26', 'ispolled': False, 'type': 'String', 'genre': 'System', 'units': ''}, 72057594119815175: {'readonly': True, 'max': 0, 'help': '', 'writeonly': False, 'label': 'Library Version', 'data_str': '3', 'min': 0, 'data': '3', 'ispolled': False, 'type': 'String', 'genre': 'System', 'units': ''}}
   ---------   
4 - Values for command class : COMMAND_CLASS_MANUFACTURER_SPECIFIC : {}
   ---------   
4 - Values for command class : COMMAND_CLASS_CRC_16_ENCAP : {}
   ---------   
4 - Values for command class : COMMAND_CLASS_DEVICE_RESET_LOCALLY : {}
   ---------   
4 - Values for command class : COMMAND_CLASS_ZWAVE_PLUS_INFO : {72057594119159809: {'readonly': True, 'max': 255, 'help': '', 'writeonly': False, 'label': 'ZWave+ Version', 'data_str': 1, 'min': 0, 'data': 1, 'ispolled': False, 'type': 'Byte', 'genre': 'System', 'units': ''}, 72057594119159830: {'readonly': True, 'max': 32767, 'help': '', 'writeonly': False, 'label': 'InstallerIcon', 'data_str': 1792, 'min': 4294934528, 'data': 1792, 'ispolled': False, 'type': 'Short', 'genre': 'System', 'units': ''}, 72057594119159846: {'readonly': True, 'max': 32767, 'help': '', 'writeonly': False, 'label': 'UserIcon', 'data_str': 1792, 'min': 4294934528, 'data': 1792, 'ispolled': False, 'type': 'Short', 'genre': 'System', 'units': ''}}

Thx

RuntimeError: dictionary changed size during iteration

libopenzwave
apt-cache show libopenzwave1.3

Package: libopenzwave1.3
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 2295
Maintainer: Lucas Nussbaum <[email protected]>
Architecture: armhf
Source: openzwave
Version: 1.4.164
Depends: libc6 (>= 2.13-28), libgcc1 (>= 1:4.4.0), libstdc++6 (>= 4.6), libudev0 (>= 0.140)
Pre-Depends: multiarch-support
Conffiles:

Hardware
Raspberry Pi 2

System
Linux homeautomation 4.4.50+ #970 Mon Feb 20 19:12:50 GMT 2017 armv6l GNU/Linux
Using Home Assistant: 0.39.3

Python release (python3 --version):
Python 3.4.2

Component/platform:
z-wave

Description of problem:
openzwave throws error "RuntimeError: dictionary changed size during iteration" on startup:

17-03-05 19:47:03 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform zwave
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/zwave.py", line 47, in setup_platform
    add_devices([ZWaveAlarmSensor(value)])
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/zwave.py", line 55, in __init__
    zwave.ZWaveDeviceEntity.__init__(self, value, DOMAIN)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/zwave/__init__.py", line 681, in __init__
    self._update_attributes()
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/zwave/__init__.py", line 712, in _update_attributes
    label=['Power'])
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/zwave/__init__.py", line 763, in get_value
    return self._value_handler(method='get', **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/zwave/__init__.py", line 731, in _value_handler
    class_id=cid, **kwargs).values())
  File "/usr/local/lib/python3.4/dist-packages/openzwave-0.3.1-py3.4.egg/openzwave/node.py", line 440, in get_values
    for value in self.values:
RuntimeError: dictionary changed size during iteration

Expected:
Some Error handling / suppression.

Additional info
Same problem mentioned here:
home-assistant/core#1872
home-assistant/core#6406

Won't build on Mac OS X

Hi,

has someone successfully build this package under Mac OS X?

Seems like there's no udev lib for OS X and so the build process breaks because of this missing dependency.

Any help is appreciated, thanks!

Can't import ZWaveOption

As #10 implies the project Home-Assistant is using this project.

When activating zwave module the following error occurs:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 96, in _setup_component
    if not component.setup(hass, config):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/zwave.py", line 67, in setup
    from openzwave.option import ZWaveOption
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 269, in __exit__
  File "<frozen importlib._bootstrap>", line 221, in release
RuntimeError: cannot release un-acquired lock

duplicate value updates...

Hello,

I'm getting random duplicates of value updates (ie calls to Louie_value_updates) on my Zwave network...
Sometimes I get three or four times the same sensor value update within a few hundreds milliseconds timeframe ?
Did anyone ever encounter such weird behavior ?

Nicolas.

P.S.:
Thanks a lot for your work, it's a pleasure to be able to use openzwave using Python ! (^_^)

Testing Python-openzwave examples

Hello,

I am testing the library python Python-openzwave for the first time but I have a problem when testing the example hello_world.py it gives me these errors:

Openzwave is installed.
Traceback (most recent call last):
File "hello_world.py", line 85, in
options.set_save_log_level('Debug')
File "build/bdist.linux-x86_64/egg/openzwave/option.py", line 149, in set_save_log_level
File "libopenzwave.pyx", line 680, in libopenzwave.PyOptions.addOptionInt (src-lib/libopenzwave/libopenzwave.cpp:7420)
TypeError: an integer is required

Do you know how to fix it?

Thanks in advance,
Wissal

pyozwweb error (on Python 3.5.3)

Is pyozwweb not Python 3 compatible? If not, please advise on the best way to use it in conjunction with my python-openzwave in a Python3 venv. Thanks!

$python3 run.py 
Traceback (most recent call last):
  File "run.py", line 35, in <module>
    from pyozwweb.app import create_app, run_app
  File "/home/hass/hass/lib/python3.5/site-packages/pyozwman-0.4.0.31-py3.5.egg/pyozwweb/app/__init__.py", line 53, in <module>
    from louie import dispatcher, All
ImportError: No module named 'louie'

'This operation would block forever' error in the manager

I'm trying out the manager feature to edit some configurations. It looks awesome! But it keeps crashing hard with the following exception:

  File "./scripts/ozwsh", line 95, in <module>
    main()
  File "./scripts/ozwsh", line 90, in main
    window.loop.run()
  File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 274, in run
    self.screen.run_wrapper(self._run)
  File "/usr/lib/python2.7/dist-packages/urwid/raw_display.py", line 268, in run_wrapper
    return fn()
  File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 339, in _run
    self.event_loop.run()
  File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 669, in run
    self._loop()
  File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 706, in _loop
    self._watch_files[fd]()
  File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 390, in _update
    self.process_input(keys)
  File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 496, in process_input
    something_handled |= bool(self.unhandled_input(k))
  File "/usr/lib/python2.7/dist-packages/urwid/main_loop.py", line 542, in unhandled_input
    return self._unhandled_input(input)
  File "/usr/local/lib/python2.7/dist-packages/pyozwweb-0.3.0b9-py2.7.egg/pyozwman/ozwsh_main.py", line 501, in _unhandled_input
    self.log.info('unhandled: %s' % repr(key))
  File "/usr/lib/python2.7/logging/__init__.py", line 1160, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1279, in _log
    self.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1289, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1329, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 755, in handle
    self.acquire()
  File "/usr/lib/python2.7/logging/__init__.py", line 706, in acquire
    self.lock.acquire()
  File "/usr/lib/python2.7/threading.py", line 174, in acquire
    rc = self.__block.acquire(blocking)
  File "gevent/_semaphore.py", line 198, in gevent._semaphore.Semaphore.acquire (gevent/gevent._semaphore.c:4038)
  File "gevent/_semaphore.py", line 226, in gevent._semaphore.Semaphore.acquire (gevent/gevent._semaphore.c:3859)
  File "gevent/_semaphore.py", line 166, in gevent._semaphore.Semaphore._do_wait (gevent/gevent._semaphore.c:3092)
  File "/usr/local/lib/python2.7/dist-packages/gevent-1.1.1-py2.7-linux-armv7l.egg/gevent/hub.py", line 606, in switch
    return greenlet.switch(self)
gevent.hub.LoopExit: ('This operation would block forever', <Hub at 0x760f6300 epoll default pending=0 ref=0 fileno=10>)

This happens somewhat randomly in the manager as I browse my network. It happens very consistently when I'm scrolling around in the configuration folder of one of my nodes.

After the crash, my console window is all messed up and I have to reconnect SSH.

I just built the latest version today on my Raspberry Pi 2 (Jessie).

Bug in adding new node

Hi guys. I use package louie in order to receive signal from pyopenzwave lib and sometimes i've encountered with strange behavior:

2016-12-14 14:00:36,904 - DEBUG (src.zwave) - ********* start add device *********
2016-12-14 14:00:36,906 - DEBUG (src.zwave) - The command is starting.
2016-12-14 14:00:36,923 - DEBUG (src.zwave) - Controller is waiting for a user action.
2016-12-14 14:00:39,603 - DEBUG (src.zwave) - The controller is communicating with the other device to carry out the command.
2016-12-14 14:00:39,765 - DEBUG (src.zwave) - The controller is communicating with the other device to carry out the command.
2016-12-14 14:00:40,174 - DEBUG (src.zwave) - The controller is communicating with the other device to carry out the command.
2016-12-14 14:00:40,243 - DEBUG (src.zwave) - The command has completed successfully.
2016-12-14 14:00:42,359 - DEBUG (src.zwave) - The command is starting.
2016-12-14 14:00:42,368 - DEBUG (src.zwave) - The controller is communicating with the other device to carry out the command.
2016-12-14 14:00:42,446 - DEBUG (src.zwave) - Controller command is on a sleep queue wait for device.
2016-12-14 14:00:42,448 - DEBUG (src.zwave) - The command has failed.
2016-12-14 14:00:44,526 - DEBUG (src.zwave) - The command is starting.
2016-12-14 14:00:44,537 - DEBUG (src.zwave) - The controller is communicating with the other device to carry out the command.
2016-12-14 14:00:44,651 - DEBUG (src.zwave) - Controller command is on a sleep queue wait for device.
2016-12-14 14:00:44,654 - DEBUG (src.zwave) - The command has failed.

Why openzwave lib make extra commands ? Thanks for the reply.

Makefile broken for raspberry?

when executing make install-api

installing library code to build/bdist.linux-armv6l/egg
running install_lib
running build_ext
building 'libopenzwave' extension
error: unknown file type '.pyx' (from 'src-lib/libopenzwave/libopenzwave.pyx')
make: *** [install-lib] Error 1

Error in manager callback: KeyError: 'valueId'

I got from time to time a error in manager callback:

[2016-09-27 01:31:34][ERROR] : Error in manager callback Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/openzwave-0.3.0-py2.7.egg/openzwave/network.py", line 948, in zwcallback self._handle_value_added(args) File "/usr/local/lib/python2.7/dist-packages/openzwave-0.3.0-py2.7.egg/openzwave/network.py", line 1473, in _handle_value_added self.nodes[args['nodeId']].add_value(args['valueId']['id']) KeyError: 'valueId'

I did not identify on what device and or value this error occur.

I think a possibility to avoid this, is to check if the key exist in args. Or do you think is something I must address to the library openzwave directly, we suppose to receive all arguments ?

Distinguish add_node / remove_node mode

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
pyozw_add_device
pyozw_remove_device

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
ozw_add_device
ozw_remove_device

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

wrong node id shows up in logs

libopenzwave
apt-cache show libopenzwave1.3

Package: libopenzwave1.3
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 2295
Maintainer: Lucas Nussbaum <[email protected]>
Architecture: armhf
Source: openzwave
Version: 1.4.164
Depends: libc6 (>= 2.13-28), libgcc1 (>= 1:4.4.0), libstdc++6 (>= 4.6), libudev0 (>= 0.140)
Pre-Depends: multiarch-support
Conffiles:

Hardware
Raspberry Pi 2

System
Linux homeautomation 4.9.14+ #977 Mon Mar 13 18:21:04 GMT 2017 armv6l GNU/Linux
Using Home Assistant: 0.41.0

Python release (python3 --version):
Python 3.4.2

Component/platform:
z-wave

Description of problem:
openzwave throws error "RuntimeError: dictionary changed size during iteration" on startup:
openzwave prints "10:27:19.696 Detail, Node033," instead of "10:27:19.696 Detail, Node022":

2017-04-01 10:27:19.603 Detail, Notification: ControllerCommand - Starting
2017-04-01 10:27:19.617 Detail,
2017-04-01 10:27:19.618 Info, Node020, Sending (Command) message (Callback ID=0x8d, Expected Reply=0x48) - ControllerCommand_RequestNodeNeighborUpdate (Node=20): 0x01, 0x05, 0x00, 0x48, 0x14, 0x8d, 0x2b
2017-04-01 10:27:19.692 Detail, Node020,   Received: 0x01, 0x05, 0x00, 0x48, 0x8d, 0x21, 0x1e
2017-04-01 10:27:19.693 Detail,
2017-04-01 10:27:19.695 Info, Node020, REQUEST_NEIGHBOR_UPDATE_STARTED
2017-04-01 10:27:19.696 Detail, Node033,   Expected callbackId was received
2017-04-01 10:27:19.699 Detail, Node033,   Expected reply was received
2017-04-01 10:27:19.701 Detail, Node033,   Message transaction complete
2017-04-01 10:27:19.703 Detail,
2017-04-01 10:27:19.705 Detail, Node020, Removing current message
2017-04-01 10:27:19.707 Detail, Notification: ControllerCommand - InProgress

Another example:

2017-04-01 10:27:32.827 Info, Node028, REQUEST_NEIGHBOR_UPDATE_STARTED
2017-04-01 10:27:32.827 Detail, Node033,   Expected callbackId was received
2017-04-01 10:27:32.828 Detail, Node033,   Expected reply was received
2017-04-01 10:27:32.828 Detail, Node033,   Message transaction complete
2017-04-01 10:27:32.828 Detail,
2017-04-01 10:27:32.828 Detail, Node028, Removing current message
2017-04-01 10:27:32.829 Detail, Notification: ControllerCommand - InProgress
2017-04-01 10:27:33.354 Detail,   Received: 0x01, 0x05, 0x00, 0x48, 0x92, 0x21, 0x01
2017-04-01 10:27:33.354 Detail,

Expected:
Print correct node id corresponding to its message.

Additional info
None at the moment from my side. Node 33 that shows up in the logs was the latest device I included. So it seems it prints the last device of the node list.

python 3

I've made some updates on the lib and add some tests in tests/lib to help

ZWaveOption throws Exception when validating the device path on Windows

Platform: Windows 10
Python 3.5 (32-bit)

In option.py, the following line: if os.path.exists(device):

returns false when given a Win32 device path such as COM4 or \.\COM4.
The constructor throws an exception saying it can't find the device. But if you comment out the check to let the execution continue past that point, everything works fine.

Any one had this issue before?

OMG ... I delete it ...

Hi guys
I'm an idot .. I try reactive the docker webhooks with a fork on my personal github and delete the main one.
Sorry for that ...
No code is lost but all issues ...
I really apologize for that

0.4.0.x Installation reports

If you successfully install and launch checks on your system, please add a comment with the following informations. It will help us if we break a specific machine/version in the future :
OS (name, version, arch) :
Python version (full version):
Python openzwave version :
Python openzwave flavor (--git, --embed, ...) :

If you fail, please open a specific issue

DeprecationWarning in Manager

Hi,

thanks for fixing the previous bug with the AttributeError bibi!
I builded and installed python-openzwave again(details about my system below) and started the manager ozwsh in /root/dev-python-openzwave/build/manager/scripts-2.7
send add_device

After executing e.g. send add_device command, the management console got broken with the following message: _ozwsh_widget.py:1107: DeprecationWarning: Call to deprecated function begin_command_add_device._ (see the last lines in the next picture)
send add_device after execution

I can execute commands like cd .. but the management console is shifted.
I tried an older version of ozwsh (where you have to start the manager via a shell script) and there is no message like this.

Can somebody reproduce the error or has some hints to fix the problem? Thanks in advance!

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

Discussion for libopenzwave redesign based on pybind11

Hi folks,

I would like to start a discussion about a rework of the libopenzwave integration based on pybind11 which I started as a experiment on this branch.

Main advantages I see so far are:

  • Significantly smaller code base required for the C++ integration (1885 to 5534 lines).
  • Added functionality for openzwave structs (like Driver and Node statistics)
  • Replaced magic numbers with there enum equivalents
  • Fixes to some Manager methods like underlining the meaning of "getValueListSelectionItem" and "getValueListSelectionValue" as well as getValueList equivalents.
  • Fixes for some bugs like destroy methods not being static or create singleton methods hidden behind a Python constructor
  • Minimal breakage (but major version update would be needed) of existing API accessing libopenzwave directly

Disadvantages:

  • C++11 is required but should be available on all current platforms by now anyway
  • Code relying on somehow broken libopenzwave PyManager and PyOptions constructors (which are not underlining the underlying singleton implementation) are doomed and would need changes including the class names being changed. This can be discussed of course.
  • enums are not iteratable. openzwave must redefine them as dicts or classes if needed

I would like to continue contributing changes for the Home Assistant project based on ArchLinux AUR. Therefore a dynamic linking build including the possibility to use "make DESTDIR=.. install" would be required to create packages. Furthermore maintenance is easier if a platform /usr/lib/libopenzwave.so can be used with /etc/openzwave no matter if C++ or the Python integration is used and build. This was somehow added as DEBIAN_PACKAGE before.

There are currently a number of open issues like broken src-api implementation which I continue to fix while this discussion takes place.

I would highly appreciate your input about the route taken and if the upstream project would be interested in taking advantage of these changes.

Why patch ValueID.h?

Hello,

I am trying to build python-openzwave against the arch linux system openzwave library, so that I can easily build other things against the same openzwave library, and because I assume it is the preferred way of building arch packages.

However, building python-openzwave with the --debian-package flag to setup-lib.py fails unless I patch the openzwave system library with this patch: https://github.com/OpenZWave/python-openzwave/blob/master/Makefile#L272

Could you explain to me what this does because it's way over my head.

Thanks

handle_value_removed not dispatching event

Hi,
I have a fibarro powerplug (FGWPE Wall Plug ). Querying the alarm class is a known issue with this device. The openzwave lib apparently handles this by deleting the value again while querying the device, which is ok. Unfortunately, this event doesn't reach the main application (louie signal doesn't arrive).
the code currently looks like this (in network.py):

        logger.debug('Z-Wave Notification ValueRemoved : %s', args)
        if args['nodeId'] not in self.nodes:
            logger.warning('Z-Wave Notification ValueRemoved (%s) for an unknown node %s', args['valueId'], args['nodeId'])
            return False
        if args['valueId']['id'] in self.nodes[args['nodeId']].values:
            logger.warning('Z-Wave Notification ValueRemoved for an unknown value (%s) on node %s', args['valueId'], args['nodeId'])
            return False
        val = self.nodes[args['nodeId']].values[args['valueId']['id']]
        if self.nodes[args['nodeId']].remove_value(args['valueId']['id']):
            dispatcher.send(self.SIGNAL_VALUE_REMOVED, \
                **{'network': self, 'node' : self.nodes[args['nodeId']], \
                    'value' : val})
            #self._handle_value(node=self.nodes[args['nodeId']], value=val)
        if args['nodeId'] in self.nodes and args['valueId']['id'] in self.nodes[args['nodeId']].values:
            del self.nodes[args['nodeId']].values[args['valueId']['id']]

in the log, I can see this:

WARNING:openzwave:Z-Wave Notification ValueRemoved for an unknown value ({'id': 72057594530512913L}) on node 29
WARNING:libopenzwave:delValueId : ValueID : 72057594530512913

So, it's the second 'if' that writes to the log and then exits the function, so that the louie signal is never raised.
Can this be changed so that the main application does receive the signal? Like so:

        logger.debug('Z-Wave Notification ValueRemoved : %s', args)
        if args['nodeId'] not in self.nodes:
            logger.warning('Z-Wave Notification ValueRemoved (%s) for an unknown node %s', args['valueId'], args['nodeId'])
            return False
        if args['valueId']['id'] in self.nodes[args['nodeId']].values:
            logger.warning('Z-Wave Notification ValueRemoved for an unknown value (%s) on node %s', args['valueId'], args['nodeId'])
        val = self.nodes[args['nodeId']].values[args['valueId']['id']]
        if self.nodes[args['nodeId']].remove_value(args['valueId']['id']):
            dispatcher.send(self.SIGNAL_VALUE_REMOVED, \
                **{'network': self, 'node' : self.nodes[args['nodeId']], \
                    'value' : val})
            #self._handle_value(node=self.nodes[args['nodeId']], value=val)
        if args['nodeId'] in self.nodes and args['valueId']['id'] in self.nodes[args['nodeId']].values:
            del self.nodes[args['nodeId']].values[args['valueId']['id']]

or does this create unexpected side effects?

PyNotifications not updated as NotificationType

hello, the notification description send form wrapper is not the right for AllNodesQueried / AllNodesQueriedSomeDead

the enum NotificationType as been reorder like ozw library
Type_AllNodesQueried = 24 # All nodes have been queried, so client application can expected complete data.
Type_AllNodesQueriedSomeDead = 25 # All nodes have been queried but some dead nodes found.

but the PyNotifications still in old order:
EnumWithDoc('AllNodesQueried').setDoc("All nodes have been queried, so client application can expected complete data."),
EnumWithDoc('AllNodesQueriedSomeDead').setDoc("All nodes have been queried but some dead nodes found."),

so libopenzwave.pyx send the wrong description.

0.4.0.x Install issue on FreeBSD

System OS details:

hass@hass ~ [hass] $uname -a
FreeBSD hass.local 11.0-RELEASE-p9 FreeBSD 11.0-RELEASE-p9 #0: Tue Apr 11 08:48:40 UTC 2017     [email protected]:/usr/obj/usr/src/sys/GENERIC  amd64

Python info:

Python 3.5.3 (default, Apr 15 2017, 08:03:17) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.8.0 (tags/RELEASE_380/final 262564)] on freebsd11
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print (sys.platform);
freebsd11

Error:

hass@hass ~ [hass] $pip3 install python_openzwave
Collecting python_openzwave
  Downloading python_openzwave-0.4.0.29.zip (133kB)
    100% |################################| 143kB 4.6MB/s 
    Complete output from command python setup.py egg_info:
    ImportError in : from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
    NameError in : class bdist_wheel(_bdist_wheel) - Use bdist_egg instead
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-9mb46u89/python-openzwave/setup.py", line 43, in <module>
        print(current_template.ctx)
      File "/tmp/pip-build-9mb46u89/python-openzwave/pyozw_setup.py", line 196, in ctx
        self._ctx = self.get_context()
      File "/tmp/pip-build-9mb46u89/python-openzwave/pyozw_setup.py", line 673, in get_context
        ctx = system_context(ctx, openzwave=self.openzwave, static=True)
      File "/tmp/pip-build-9mb46u89/python-openzwave/pyozw_setup.py", line 178, in system_context
        raise RuntimeError("Can't detect plateform")
    RuntimeError: Can't detect plateform
    <pyozw_setup.EmbedTemplate object at 0x8061596a0>
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9mb46u89/python-openzwave/

makefile incorrect locates python3 in venv

the algorithm to locate python3 in a venv is not building the path correctly
sample path calculated by make file:

/srv/homeassistant/bin//srv/homeassistant/bin/python3

path should be:
/srv/homeassistant/bin/python3

get multiInstance attribute from MULTI_INSTANCE_ASSOCIATION

If a device support MultiInstanceAssociation, not all groups they support as well.
We need to return the attribute "multiInstance" from ozw.

Example:

<CommandClass id="142" name="COMMAND_CLASS_MULTI_INSTANCE_ASSOCIATION" version="1" request_flags="5" innif="true">
                <Instance index="1" />
                <Associations num_groups="2">
                    <Group index="1" max_associations="5" label="Button1" auto="false" multiInstance="true" />
                    <Group index="2" max_associations="5" label="Button2" auto="false" multiInstance="true" />
                    <Group index="3" max_associations="1" label="Lifeline" auto="true">
                        <Node id="1" />
                    </Group>
                </Associations>
            </CommandClass>

Only group index 1 and 2 support MULTI_INSTANCE_ASSOCIATION.

Build the app in Windows

Hi

I was trying to build the lib and api on windows but I'm struggling a lot because it says "error: Don't know how to compile src-lib/libopenzwave/libopenzwave.pyx"

I already installed cython with pip... does anyone knows how to workaround this?

I am willing to contribute with the windows setup :)

Python 3 config path TypeError: expected bytes, str found

With python3 I am seeing the following issue...

    options = ZWaveOption(
        config[DOMAIN].get(CONF_USB_STICK_PATH, DEFAULT_CONF_USB_STICK_PATH),
        user_path=hass.config.config_dir,
        config_path=str(config[DOMAIN].get('config_path',
                                       DEFAULT_ZWAVE_CONFIG_PATH),))
  File "/home/homeassistant/.pyenv/versions/3.4.2/lib/python3.4/site-packages/openzwave-0.3.0b8-py3.4.egg/openzwave/option.py", line 76, in __init__
    libopenzwave.PyOptions.__init__(self, config_path=config_path, user_path=user_path, cmd_line=cmd_line)
  File "libopenzwave.pyx", line 579, in libopenzwave.PyOptions.__init__ (src-lib/libopenzwave/libopenzwave.cpp:6874)
  File "libopenzwave.pyx", line 582, in libopenzwave.PyOptions.create (src-lib/libopenzwave/libopenzwave.cpp:6966)
TypeError: expected bytes, str found

I compiled from source using the INSTALL_ARCH.txt method.

I have compiled from source multiple times and can't seem to actually get this to work... I am wondering if it my be a CYthon issue.

The Cython version is...

Cython (0.22)

I also tried to compile from the master branch and not using that INSTALL_ARCH.txt method... It installed but I see the exact same issue.

Unable to link on Windows

Following the adjusted build process for Windows, everything is working except:

python setup-lib.py install

When run, this command fails with:

fatal error C1905: Front end and back end not compatible (must target same proce
ssor).
LINK : fatal error LNK1257: code generation failed

I think because it's trying to use x86 libraries from the windows SDK, but the rest is built in amd64. Any ideas on this?

Help compiling on ArchLinux

Hi,

I'm trying to compile this project on my Raspberry 2 but I have somes errors:

python setup-lib.py build --build-base build/lib
running build
running build_ext
skipping 'src-lib/libopenzwave/libopenzwave.cpp' Cython extension (up-to-date)
building 'libopenzwave' extension
gcc -pthread -fno-strict-aliasing -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -DNDEBUG -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -I/usr/include/openzwave -I/usr/include/openzwave/value_classes -I/usr/include/openzwave/platform -Isrc-lib/libopenzwave -I/usr/include/python2.7 -c src-lib/libopenzwave/libopenzwave.cpp -o build/lib/temp.linux-armv7l-2.7/src-lib/libopenzwave/libopenzwave.o
src-lib/libopenzwave/libopenzwave.cpp:922:87: error: 'ValueType' is not an enumerator-name
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueType(enum OpenZWave::ValueType value);
                                                                                       ^
src-lib/libopenzwave/libopenzwave.cpp:922:98: error: 'ValueType' in namespace 'OpenZWave' does not name a type
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueType(enum OpenZWave::ValueType value);
                                                                                                  ^
src-lib/libopenzwave/libopenzwave.cpp:934:88: error: 'ValueGenre' is not an enumerator-name
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueGenre(enum OpenZWave::ValueGenre value);
                                                                                        ^
src-lib/libopenzwave/libopenzwave.cpp:934:99: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueGenre(enum OpenZWave::ValueGenre value);
                                                                                                   ^
src-lib/libopenzwave/libopenzwave.cpp: In function 'PyObject* __pyx_pf_12libopenzwave_9PyManager_250beginControllerCommand(__pyx_obj_12libopenzwave_PyManager*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*)':
src-lib/libopenzwave/libopenzwave.cpp:25676:204: warning: 'bool OpenZWave::Manager::BeginControllerCommand(uint32, OpenZWave::Driver::ControllerCommand, OpenZWave::Driver::pfnControllerCallback_t, void*, bool, uint8, uint8)' is deprecated [-Wdeprecated-declarations]
   __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->manager->BeginControllerCommand(__pyx_t_1, __pyx_t_2, __pyx_f_12libopenzwave_ctrl_callback, ((void *)__pyx_v_pythonfunc), __pyx_t_3, __pyx_t_4, __pyx_t_5)); if (unlikely(!__pyx_t_6)) {__
                                                                                                                                                                                                            ^
src-lib/libopenzwave/libopenzwave.cpp:366:36: note: in definition of macro '__Pyx_PyBool_FromLong'
 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
                                    ^
In file included from src-lib/libopenzwave/libopenzwave.cpp:265:0:
/usr/include/openzwave/Manager.h:1715:19: note: declared here
   DEPRECATED bool BeginControllerCommand( uint32 const _homeId, Driver::ControllerCommand _command, Driver::pfnControllerCallback_t _callback = NULL, void* _context = NULL, bool _highPower = false, uint8 _nodeId = 0xff, uint8 _arg = 0 )
                   ^
src-lib/libopenzwave/libopenzwave.cpp: At global scope:
src-lib/libopenzwave/libopenzwave.cpp:39643:87: error: 'ValueType' is not an enumerator-name
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueType(enum OpenZWave::ValueType value) {
                                                                                       ^
src-lib/libopenzwave/libopenzwave.cpp:39643:98: error: 'ValueType' in namespace 'OpenZWave' does not name a type
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueType(enum OpenZWave::ValueType value) {
                                                                                                  ^
src-lib/libopenzwave/libopenzwave.cpp: In function 'PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueType(int)':
src-lib/libopenzwave/libopenzwave.cpp:39644:16: error: 'ValueType' is not an enumerator-name
     const enum OpenZWave::ValueType neg_one = (enum OpenZWave::ValueType) -1, const_zero = (enum OpenZWave::ValueType) 0;
                ^
src-lib/libopenzwave/libopenzwave.cpp:39644:27: error: 'ValueType' in namespace 'OpenZWave' does not name a type
     const enum OpenZWave::ValueType neg_one = (enum OpenZWave::ValueType) -1, const_zero = (enum OpenZWave::ValueType) 0;
                           ^
src-lib/libopenzwave/libopenzwave.cpp:39644:53: error: 'ValueType' is not an enumerator-name
     const enum OpenZWave::ValueType neg_one = (enum OpenZWave::ValueType) -1, const_zero = (enum OpenZWave::ValueType) 0;
                                                     ^
src-lib/libopenzwave/libopenzwave.cpp:39644:64: error: 'ValueType' in namespace 'OpenZWave' does not name a type
     const enum OpenZWave::ValueType neg_one = (enum OpenZWave::ValueType) -1, const_zero = (enum OpenZWave::ValueType) 0;
                                                                ^
src-lib/libopenzwave/libopenzwave.cpp:39645:39: error: 'const_zero' was not declared in this scope
     const int is_unsigned = neg_one > const_zero;
                                       ^
src-lib/libopenzwave/libopenzwave.cpp:39647:25: error: 'ValueType' is not an enumerator-name
         if (sizeof(enum OpenZWave::ValueType) < sizeof(long)) {
                         ^
src-lib/libopenzwave/libopenzwave.cpp:39647:36: error: 'ValueType' in namespace 'OpenZWave' does not name a type
         if (sizeof(enum OpenZWave::ValueType) < sizeof(long)) {
                                    ^
src-lib/libopenzwave/libopenzwave.cpp:39649:32: error: 'ValueType' is not an enumerator-name
         } else if (sizeof(enum OpenZWave::ValueType) <= sizeof(unsigned long)) {
                                ^
src-lib/libopenzwave/libopenzwave.cpp:39649:43: error: 'ValueType' in namespace 'OpenZWave' does not name a type
         } else if (sizeof(enum OpenZWave::ValueType) <= sizeof(unsigned long)) {
                                           ^
src-lib/libopenzwave/libopenzwave.cpp:39651:32: error: 'ValueType' is not an enumerator-name
         } else if (sizeof(enum OpenZWave::ValueType) <= sizeof(unsigned PY_LONG_LONG)) {
                                ^
src-lib/libopenzwave/libopenzwave.cpp:39651:43: error: 'ValueType' in namespace 'OpenZWave' does not name a type
         } else if (sizeof(enum OpenZWave::ValueType) <= sizeof(unsigned PY_LONG_LONG)) {
                                           ^
src-lib/libopenzwave/libopenzwave.cpp:39655:25: error: 'ValueType' is not an enumerator-name
         if (sizeof(enum OpenZWave::ValueType) <= sizeof(long)) {
                         ^
src-lib/libopenzwave/libopenzwave.cpp:39655:36: error: 'ValueType' in namespace 'OpenZWave' does not name a type
         if (sizeof(enum OpenZWave::ValueType) <= sizeof(long)) {
                                    ^
src-lib/libopenzwave/libopenzwave.cpp:39657:32: error: 'ValueType' is not an enumerator-name
         } else if (sizeof(enum OpenZWave::ValueType) <= sizeof(PY_LONG_LONG)) {
                                ^
src-lib/libopenzwave/libopenzwave.cpp:39657:43: error: 'ValueType' in namespace 'OpenZWave' does not name a type
         } else if (sizeof(enum OpenZWave::ValueType) <= sizeof(PY_LONG_LONG)) {
                                           ^
src-lib/libopenzwave/libopenzwave.cpp:39664:57: error: 'ValueType' is not an enumerator-name
         return _PyLong_FromByteArray(bytes, sizeof(enum OpenZWave::ValueType),
                                                         ^
src-lib/libopenzwave/libopenzwave.cpp:39664:68: error: 'ValueType' in namespace 'OpenZWave' does not name a type
         return _PyLong_FromByteArray(bytes, sizeof(enum OpenZWave::ValueType),
                                                                    ^
src-lib/libopenzwave/libopenzwave.cpp:39665:47: error: in argument to unary !
                                      little, !is_unsigned);
                                               ^
src-lib/libopenzwave/libopenzwave.cpp: At global scope:
src-lib/libopenzwave/libopenzwave.cpp:39957:88: error: 'ValueGenre' is not an enumerator-name
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueGenre(enum OpenZWave::ValueGenre value) {
                                                                                        ^
src-lib/libopenzwave/libopenzwave.cpp:39957:99: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueGenre(enum OpenZWave::ValueGenre value) {
                                                                                                   ^
src-lib/libopenzwave/libopenzwave.cpp: In function 'PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueGenre(int)':
src-lib/libopenzwave/libopenzwave.cpp:39958:16: error: 'ValueGenre' is not an enumerator-name
     const enum OpenZWave::ValueGenre neg_one = (enum OpenZWave::ValueGenre) -1, const_zero = (enum OpenZWave::ValueGenre) 0;
                ^
src-lib/libopenzwave/libopenzwave.cpp:39958:27: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
     const enum OpenZWave::ValueGenre neg_one = (enum OpenZWave::ValueGenre) -1, const_zero = (enum OpenZWave::ValueGenre) 0;
                           ^
src-lib/libopenzwave/libopenzwave.cpp:39958:54: error: 'ValueGenre' is not an enumerator-name
     const enum OpenZWave::ValueGenre neg_one = (enum OpenZWave::ValueGenre) -1, const_zero = (enum OpenZWave::ValueGenre) 0;
                                                      ^
src-lib/libopenzwave/libopenzwave.cpp:39958:65: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
     const enum OpenZWave::ValueGenre neg_one = (enum OpenZWave::ValueGenre) -1, const_zero = (enum OpenZWave::ValueGenre) 0;
                                                                 ^
src-lib/libopenzwave/libopenzwave.cpp:39959:39: error: 'const_zero' was not declared in this scope
     const int is_unsigned = neg_one > const_zero;
                                       ^
src-lib/libopenzwave/libopenzwave.cpp:39961:25: error: 'ValueGenre' is not an enumerator-name
         if (sizeof(enum OpenZWave::ValueGenre) < sizeof(long)) {
                         ^
src-lib/libopenzwave/libopenzwave.cpp:39961:36: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
         if (sizeof(enum OpenZWave::ValueGenre) < sizeof(long)) {
                                    ^
src-lib/libopenzwave/libopenzwave.cpp:39963:32: error: 'ValueGenre' is not an enumerator-name
         } else if (sizeof(enum OpenZWave::ValueGenre) <= sizeof(unsigned long)) {
                                ^
src-lib/libopenzwave/libopenzwave.cpp:39963:43: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
         } else if (sizeof(enum OpenZWave::ValueGenre) <= sizeof(unsigned long)) {
                                           ^
src-lib/libopenzwave/libopenzwave.cpp:39965:32: error: 'ValueGenre' is not an enumerator-name
         } else if (sizeof(enum OpenZWave::ValueGenre) <= sizeof(unsigned PY_LONG_LONG)) {
                                ^
src-lib/libopenzwave/libopenzwave.cpp:39965:43: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
         } else if (sizeof(enum OpenZWave::ValueGenre) <= sizeof(unsigned PY_LONG_LONG)) {
                                           ^
src-lib/libopenzwave/libopenzwave.cpp:39969:25: error: 'ValueGenre' is not an enumerator-name
         if (sizeof(enum OpenZWave::ValueGenre) <= sizeof(long)) {
                         ^
src-lib/libopenzwave/libopenzwave.cpp:39969:36: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
         if (sizeof(enum OpenZWave::ValueGenre) <= sizeof(long)) {
                                    ^
src-lib/libopenzwave/libopenzwave.cpp:39971:32: error: 'ValueGenre' is not an enumerator-name
         } else if (sizeof(enum OpenZWave::ValueGenre) <= sizeof(PY_LONG_LONG)) {
                                ^
src-lib/libopenzwave/libopenzwave.cpp:39971:43: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
         } else if (sizeof(enum OpenZWave::ValueGenre) <= sizeof(PY_LONG_LONG)) {
                                           ^
src-lib/libopenzwave/libopenzwave.cpp:39978:57: error: 'ValueGenre' is not an enumerator-name
         return _PyLong_FromByteArray(bytes, sizeof(enum OpenZWave::ValueGenre),
                                                         ^
src-lib/libopenzwave/libopenzwave.cpp:39978:68: error: 'ValueGenre' in namespace 'OpenZWave' does not name a type
         return _PyLong_FromByteArray(bytes, sizeof(enum OpenZWave::ValueGenre),
                                                                    ^
src-lib/libopenzwave/libopenzwave.cpp:39979:47: error: in argument to unary !
                                      little, !is_unsigned);
                                               ^
error: command 'gcc' failed with exit status 1
OS: ArchLinux
GCC 5.2.0
Cython 0.23.2
Python 2.7.10 (python-dev OK)
Openzwave 1.3
Others informations: python-pip python-docutils python-setuptools python-louie OK

All directories and paths are correct. I am blocked, can you help me ?

cannot import name 'PyLogLevels'

Running HA on Windows 7 x64, python 3.5.2. Set up my dev envionment.

Successfully built openzwave and the python wrapper.

HA config:
zwave: usb_path: COM4 config_path: C:\Users\Garrett\Documents\open-zwave\config

Error in log when starting HA:
17-01-13 13:40:50 homeassistant.bootstrap: Error during setup of component zwave Traceback (most recent call last): File "C:\Program Files (x86)\Python35-32\lib\site-packages\homeassistant\bootstrap.py", line 151, in _async_setup_component None, component.setup, hass, config) File "C:\Program Files (x86)\Python35-32\lib\asyncio\futures.py", line 361, in __iter__ yield self # This tells Task to wait for completion. File "C:\Program Files (x86)\Python35-32\lib\asyncio\tasks.py", line 296, in _wakeup future.result() File "C:\Program Files (x86)\Python35-32\lib\asyncio\futures.py", line 274, in result raise self._exception File "C:\Program Files (x86)\Python35-32\lib\concurrent\futures\thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "C:\Program Files (x86)\Python35-32\lib\site-packages\homeassistant\components\zwave\__init__.py", line 256, in setup from openzwave.option import ZWaveOption File "C:\Program Files (x86)\Python35-32\lib\site-packages\openzwave-0.3.1-py3.5.egg\openzwave\option.py", line 30, in <module> from libopenzwave import PyLogLevels ImportError: cannot import name 'PyLogLevels'

anyone seen this or have any thoughts?

Python3 branch is not compiling

I get these errors when compiling:

src-lib/libopenzwave/libopenzwave.cpp:922:87: error: ‘ValueType’ is not an enumerator-name
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueType(enum OpenZWave::ValueType value);
                                                                                       ^
src-lib/libopenzwave/libopenzwave.cpp:922:98: error: ‘ValueType’ in namespace ‘OpenZWave’ does not name a type
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueType(enum OpenZWave::ValueType value);
                                                                                                  ^
src-lib/libopenzwave/libopenzwave.cpp:934:88: error: ‘ValueGenre’ is not an enumerator-name
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueGenre(enum OpenZWave::ValueGenre value);
                                                                                        ^
src-lib/libopenzwave/libopenzwave.cpp:934:99: error: ‘ValueGenre’ in namespace ‘OpenZWave’ does not name a type
 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__OpenZWave_3a__3a_ValueGenre(enum OpenZWave::ValueGenre value);

data in ZWaveValue Object

Hi All,

I inspected in python-openzwave the ZWaveValue Objects which are under the Nodes Objects.
In the data field, there is sometimes an unicode, especially on configuration parameters.

E.g. the Fibaro FGMS001 Motion Sensor has a config parameter called "LED indicating tamper alarm".
It saves in the data field the unicode string instead of an integer.
image

Instead of a unicode in the data field , I wanted to save the integer value, like:
image

The background: When setting parameters i use the set_config_param method (where the value to set has an integer,too). I recognize when the config value has changed and I want to save this. But instead of an unicode, I want to save the integer value, which I have set via set_config_param before.

Just tried data_items field in the ZWaveValue Object to get the integer value, but this is a "set", so an unordered collection, without an index.

I checked openzwave, and when the node is configured, the integer will be send, but it will not be forwarded to python-openzwave as an integer. Instead you get sometimes the unicode, like in the first picture.
image

Has someone an idea how to get in this situation an integer value instead of an unicode value?
Thanks in advance!

ImportError: libopenzwave.so: undefined symbol: ns_parserr

I try to run the Dev branch of openzwave lib but I got a undefined symbol Error on Import ZWaveController

from openzwave.controller import ZWaveController
File "/usr/local/lib/python2.7/dist-packages/openzwave-0.3.0-py2.7.egg/openzwave/controller.py", line 34, in <module>
from libopenzwave import PyStatDriver, PyControllerState
ImportError: /usr/local/lib/python2.7/dist-packages/libopenzwave-0.3.0-py2.7-linux-armv7l.egg/libopenzwave.so: undefined symbol: ns_parserr

I understand this version is not yet ready but, I want validated new CC implementation to be sure everything still ok with the wrapper and propose PR if needed.

many thank for your help

gevent in python-openzwave

Hi All,
in the python src-api files for openzwave (command.py, controller.py, network.py etc.) there is gevent imported with monkey.patch_all(). I am using multiprocessing for another project in python which uses python-openzwave. I am running in errors and It seems to be a general problem (http://stackoverflow.com/questions/8678307/gevent-monkeypatching-breaking-multiprocessing). I tried to comment out all gevent imports and run python-openzwave without errors.
image

My question is: Is it necessary to use gevent in python-openzwave or can I comment it out (without any side effects)?

Thanks in advance for your response ;)

Error on Notification VALUE_ADDED

on handle_value_added event the wrapper send notification VALUE_ADDED with value details
in network.py the line

logger.debug(\'Z-Wave Notification Value : node=%s value=%s\' % (node, value))

will raise exception with data of type RAW like the zipato RFid reader

/value.py", line 85, in __str__
    (self._network.home_id_str, self._object_id, self.parent_id, self.label, self.data)
', '  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
', "UnicodeDecodeError: 'utf8' codec can't decode byte 0x8f in position 0: invalid start byte
"]

the logger message construction generate this error, and the notification are never send.

Exception KeyError in 'libopenzwave.notif_callback' ignored

with all device support COMMAND_CLASS_CENTRAL_SCENE, during the discovering I got a error:
Exception KeyError: (91,) in 'libopenzwave.notif_callback' ignored

20-04-2016 23:16:59 | debug | value_added. 223 Basic
Exception KeyError: (91,) in 'libopenzwave.notif_callback' ignored
20-04-2016 23:16:59 | debug | value_added. 223 ZWave+ Version
20-04-2016 23:16:59 | debug | value_added. 223 InstallerIcon
20-04-2016 23:16:59 | debug | value_added. 223 UserIcon

if I check the xml

<CommandClass id="32" name="COMMAND_CLASS_BASIC" version="1" request_flags="4">
                <Instance index="1" />
                <Value type="byte" genre="basic" instance="1" index="0" label="Basic" units="" read_only="false" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="0" />
            </CommandClass>
            <CommandClass id="86" name="COMMAND_CLASS_CRC_16_ENCAP" version="1" request_flags="4" innif="true">
                <Instance index="1" />
            </CommandClass>
            <CommandClass id="90" name="COMMAND_CLASS_DEVICE_RESET_LOCALLY" version="1" request_flags="4" innif="true">
                <Instance index="1" />
            </CommandClass>
            <CommandClass id="91" name="COMMAND_CLASS_CENTRAL_SCENE" version="1" request_flags="4" innif="true" scenecount="0">
                <Instance index="1" />
                <Value type="int" genre="system" instance="1" index="0" label="Scene Count" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-2147483648" max="2147483647" value="0" />
            </CommandClass>
            <CommandClass id="94" name="COMMAND_CLASS_ZWAVE_PLUS_INFO" version="1" request_flags="4" innif="true">
                <Instance index="1" />
                <Value type="byte" genre="system" instance="1" index="0" label="ZWave+ Version" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="1" />
                <Value type="short" genre="system" instance="1" index="1" label="InstallerIcon" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-32768" max="32767" value="5632" />
                <Value type="short" genre="system" instance="1" index="2" label="UserIcon" units="" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="-32768" max="32767" value="5632" />
            </CommandClass>

the error occurs with CC COMMAND_CLASS_CENTRAL_SCENE for value Scene Count.

I will also continue to investigate from my side and or propose a patch

Setting Up ZStick USB Dongle with UBUNTU

I am having issues opening up serial ports on devices while trying to run the example files.
I tried different USB ports for "/dev/ttyUSB0". Used lsblk and lsusb to see what ports to use, but still getting errors as shown in attached. Any help is much obliged, cheers!

image

Why is the installation so non-standard?

Hi,

Thanks for making this python binding.
I'm using linux and the git version of python-openzwave, I was wondering why the installation of this package is so non-standard? why can't we just pip install python-openzwave?
Also why does make build clone its own version of openzwave and build it although I already have it installed (.so, .h, ozw_config, .pc, ...)

Cheers

Error with pyozw_shell on FreeBSD

When running the ozw manager, I get the following (on Python 3.5.3):

 $pyozw_shell -d /dev/cuaU0 -l    
Traceback (most recent call last):
  File "/home/hass/hass/bin/pyozw_shell", line 4, in <module>
    __import__('pkg_resources').run_script('pyozwman==0.4.0.31', 'pyozw_shell')
  File "/home/hass/hass/lib/python3.5/site-packages/pkg_resources/__init__.py", line 738, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/hass/hass/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1497, in run_script
    source = open(script_filename).read()
  File "/usr/local/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 280: ordinal not in range(128)

UnicodeDecodeError in a logging.debug() call

Hello,

When my network start I get the following errors (with some debug around to put it back in context):

DEBUG:libopenzwave:notif_callback : new notification
DEBUG:libopenzwave:notif_callback : Notification (type,nodeId) : (None, 9)
DEBUG:libopenzwave:addValueId : ValueID : 72057594194739225
DEBUG:libopenzwave:addValueId : Notification : {'homeId': 3741043003, 'valueId': {'index': 1, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f@\n\xad)\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 1:', 'genre': 'User', 'id': 72057594194739225L}, 'notificationType': 'ValueAdded', 'nodeId': 9}
DEBUG:libopenzwave:notif_callback : call callback context
DEBUG:openzwave:zwcallback args=[{'homeId': 3741043003, 'valueId': {'index': 1, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f@\n\xad)\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 1:', 'genre': 'User', 'id': 72057594194739225L}, 'notificationType': 'ValueAdded', 'nodeId': 9}]
DEBUG:openzwave:Z-Wave Notification ValueAdded : {'homeId': 3741043003, 'valueId': {'index': 1, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f@\n\xad)\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 1:', 'genre': 'User', 'id': 72057594194739225L}, 'notificationType': 'ValueAdded', 'nodeId': 9}
DEBUG:openzwave:Create object value (valueId:72057594194739225)
ERROR:openzwave:Error in manager callback : ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 947, in zwcallback\n    self._handle_value_added(args)\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 1478, in _handle_value_added\n    self._handle_value(node=self.nodes[args[\'nodeId\']], value=self.nodes[args[\'nodeId\']].values[args[\'valueId\'][\'id\']])\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 1450, in _handle_value\n    logger.debug(\'Z-Wave Notification Value : node=%s value=%s\' % (node, value))\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/value.py", line 85, in __str__\n    (self._network.home_id_str, self._object_id, self.parent_id, self.label, self.data)\n', "UnicodeDecodeError: 'ascii' codec can't decode byte 0x8f in position 0: ordinal not in range(128)\n"]
DEBUG:libopenzwave:notif_callback : end
DEBUG:libopenzwave:notif_callback : new notification
DEBUG:libopenzwave:notif_callback : Notification (type,nodeId) : (None, 9)
DEBUG:libopenzwave:addValueId : ValueID : 72057594194739241
DEBUG:libopenzwave:addValueId : Notification : {'homeId': 3741043003, 'valueId': {'index': 2, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f9^T*\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 2:', 'genre': 'User', 'id': 72057594194739241L}, 'notificationType': 'ValueAdded', 'nodeId': 9}
DEBUG:libopenzwave:notif_callback : call callback context
DEBUG:openzwave:zwcallback args=[{'homeId': 3741043003, 'valueId': {'index': 2, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f9^T*\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 2:', 'genre': 'User', 'id': 72057594194739241L}, 'notificationType': 'ValueAdded', 'nodeId': 9}]
DEBUG:openzwave:Z-Wave Notification ValueAdded : {'homeId': 3741043003, 'valueId': {'index': 2, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f9^T*\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 2:', 'genre': 'User', 'id': 72057594194739241L}, 'notificationType': 'ValueAdded', 'nodeId': 9}
DEBUG:openzwave:Create object value (valueId:72057594194739241)
ERROR:openzwave:Error in manager callback : ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 947, in zwcallback\n    self._handle_value_added(args)\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 1478, in _handle_value_added\n    self._handle_value(node=self.nodes[args[\'nodeId\']], value=self.nodes[args[\'nodeId\']].values[args[\'valueId\'][\'id\']])\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 1450, in _handle_value\n    logger.debug(\'Z-Wave Notification Value : node=%s value=%s\' % (node, value))\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/value.py", line 85, in __str__\n    (self._network.home_id_str, self._object_id, self.parent_id, self.label, self.data)\n', "UnicodeDecodeError: 'ascii' codec can't decode byte 0x8f in position 0: ordinal not in range(128)\n"]
DEBUG:libopenzwave:notif_callback : end
DEBUG:libopenzwave:notif_callback : new notification
DEBUG:libopenzwave:notif_callback : Notification (type,nodeId) : (None, 9)
DEBUG:libopenzwave:addValueId : ValueID : 72057594194739257
DEBUG:libopenzwave:addValueId : Notification : {'homeId': 3741043003, 'valueId': {'index': 3, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f\xc86\xad)\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 3:', 'genre': 'User', 'id': 72057594194739257L}, 'notificationType': 'ValueAdded', 'nodeId': 9}
DEBUG:libopenzwave:notif_callback : call callback context
DEBUG:openzwave:zwcallback args=[{'homeId': 3741043003, 'valueId': {'index': 3, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f\xc86\xad)\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 3:', 'genre': 'User', 'id': 72057594194739257L}, 'notificationType': 'ValueAdded', 'nodeId': 9}]
DEBUG:openzwave:Z-Wave Notification ValueAdded : {'homeId': 3741043003, 'valueId': {'index': 3, 'units': u'', 'type': 'Raw', 'nodeId': 9, 'value': '\x8f\xc86\xad)\x00\x01\x04\x00\x00', 'commandClass': 'COMMAND_CLASS_USER_CODE', 'instance': 1, 'readOnly': False, 'homeId': 3741043003, 'label': u'Code 3:', 'genre': 'User', 'id': 72057594194739257L}, 'notificationType': 'ValueAdded', 'nodeId': 9}
DEBUG:openzwave:Create object value (valueId:72057594194739257)
ERROR:openzwave:Error in manager callback : ['Traceback (most recent call last):\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 947, in zwcallback\n    self._handle_value_added(args)\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 1478, in _handle_value_added\n    self._handle_value(node=self.nodes[args[\'nodeId\']], value=self.nodes[args[\'nodeId\']].values[args[\'valueId\'][\'id\']])\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/network.py", line 1450, in _handle_value\n    logger.debug(\'Z-Wave Notification Value : node=%s value=%s\' % (node, value))\n', '  File "/usr/local/lib/python2.7/site-packages/pyozwweb-0.3.0b7-py2.7.egg/openzwave/value.py", line 85, in __str__\n    (self._network.home_id_str, self._object_id, self.parent_id, self.label, self.data)\n', "UnicodeDecodeError: 'ascii' codec can't decode byte 0x8f in position 0: ordinal not in range(128)\n"]
DEBUG:libopenzwave:notif_callback : end

It seems that when it init the values from my rfid keypad, it comes to read the user code which are actually the tag ids stored as raw byte. That seems to trip off one of the logging.debug() call.
Unfortunately, it could be that it stops the processing of the notification here and does not forward it to the application ;(.

Cheers,
Axel

Non-integer value passed to libopenzwave.PyManager.cancelControllerCommand

Got this while starting and stopping python-openzwave many times. May look into it myself, but seems just to be an invalid binding or value passed to the C++ function.

Traceback (most recent call last):
File "home.py", line 285, in
main()
File "home.py", line 278, in main
network.stop()
File "/usr/local/lib/python2.7/dist-packages/openzwave-0.3.0b5-py2.7.egg/openzwave/network.py", line 396, in stop
self.controller.stop()
File "/usr/local/lib/python2.7/dist-packages/openzwave-0.3.0b5-py2.7.egg/openzwave/controller.py", line 201, in stop
self.cancel_command()
File "/usr/local/lib/python2.7/dist-packages/openzwave-0.3.0b5-py2.7.egg/openzwave/controller.py", line 804, in cancel_command
return self._network.manager.cancelControllerCommand(self.home_id)
File "libopenzwave.pyx", line 3765, in libopenzwave.PyManager.cancelControllerCommand (src-lib/libopenzwave/libopenzwave.cpp:200
53)
TypeError: an integer is required

Binary switch value inverted ?

Hi,

I just noticed something weird. I'll take the examples/hello_world.py file as reference to simplify.
When the script does the 'Activate switch' part, it does a set_switch(val,True) to turn the switch on. So far, everything is fine.
Problem is, in the louie_value_update callback, the current value (for the switch turned on) is False:
Hello from value : home_id: [0x01852cfc] id: [72057594093060096] parent_id: [3] label: [Switch] data: [False].
Same thing again when the script disable the switch with set_switch(val,False), the callback says the switch data is True.

Is this normal in the ZWave protocol or is this an issue ?

Cheers.

Install instructions in INSTALL_ARCH.txt incorrect

"sudo make deps" fails because the make target is missing.

I had to do this to get it to work on Raspberry Pi Jessie:

sudo make arch-deps
sudo make developper-deps (please note the incorrect spelling of developer)
sudo make build
sudo make install-api

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.