项目作者: topcats

项目描述 :
Raspberry PI Z-Wave board python Interface
高级语言: Python
项目地址: git://github.com/topcats/raspberry-zwave-python.git
创建时间: 2019-05-07T11:51:55Z
项目社区:https://github.com/topcats/raspberry-zwave-python

开源协议:

下载


raspberry-zwave-python

Raspberry PI Z-Wave board Python Interface
Provides a quick and easy interface into the ZWAY Automation API

This was orignally written for Python 2.7

But there now is a Python 3 version.

Due to the way Python 2 and Python 3 work, there are 2 different libraries, but the calls and functionally remains the same.

How to Use - Python 3

  1. from zWaveApi3 import *
  2. oZWave = zWaveApi3('username', 'password', 'zwaveurl')
  3. oZDevices = oZWave.getDevices()

How to Use - Python 2

  1. from zWaveApi import *
  2. oZWave = zWaveApi('username', 'password', 'zwaveurl')
  3. oZDevices = oZWave.getDevices()

Requires

  • json
  • Python 3

    • http.client
    • urllib.parse
  • Python 2:

    • urllib2
    • urllib
    • httplib

Functions

getDevices()

Returns a list of zWave Devices as a JSON array

setDeviceCommand(deviceid, newcommand)

Sends a Command to a zWave Device

deviceid - The unique zWave device ID

newcommand - The Require command for the device
This depends on the device type, see below

  • switchMultilevel : on / off / min / max / exact?level=40 / increase / decrease / update
  • switchBinary : on / off / update
  • toggleButton : on

Returns either 1 or 0 dependant on command being accepted