Library, implementing websocket connection to ZWave-Me
Project description
ZWave-Me-WS is a websocket connection library for Z-Wave.Me Z-Way controllers
Installing
To install this package use:
pip install zwave-me-ws
Usage
To use the connector initialize the API using:
from zwave_me_ws import ZWaveMe, ZWaveMeData
zwave_api = ZWaveMe(
on_device_create=on_device_func
on_device_update=on_device_update_func,
on_new_device=on_device_add_func,
token="....", # Z-Way access token in the form .../... (remote) of /... (local)
url="...", # wss://find.z-wave.me or ws://IP:8083
platforms=[...]
)
def on_device_add_func(self, device: ZWaveMeData)
def on_device_create_func(self, devices: list[ZWaveMeData])
def on_device_update_func(self, new_info: ZWaveMeData)
Here platforms
is the list of deviceType fields to handle. Used to filter only types supported by your application. For example,
["sensorBinary", "lightMultilevel", "toggleButton", "thermostat", "motor", "fan", "doorlock", "switchMultilevel", "switchBinary", "sensorMultilevel", "siren", "switchRGBW", "switchRGB"]
.
Available functions:
devices = zwave_api.get_devices()
zwave_api.send_command(device_id, command) # command can be "on", "off", "exact?level=..", "open", "close"
is_connected = zwave_api.get_connection()
zwave_api.close_ws()
Device (ZWaveMeData) has the following fields:
id: str
deviceType: str
title: str
level: Union[str, int, float]
deviceIdentifier: str
probeType: str
scaleTitle: str
min: str
max: str
color: dict
isFailed: bool
locationName: str
manufacturer: str
firmware: str
tags: list[str]
nodeId: str
creatorId: str
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zwave_me_ws-0.4.0.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for zwave_me_ws-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57cb51c8c650ee690c51ca32fa7c4242f1ae1b9dd883dbbaa800c7844afb824b |
|
MD5 | 55964d811d4f38fd18994d6fca224b18 |
|
BLAKE2b-256 | c8599b79f9996fb3b59b8eff1b5b19b8d5b093f2cdd84020ae25b50d6fc6ef8a |