ISY99 Controller Rest and Websocket client v5 firmware
Project description
ISY994v5
Class based interface to the ISY994 device with V5 firmware.
As of version 0.6.6, using aiohttp and asyncio to manage the HTTP and WebSocket connection to the ISY.
Provides a common interface to all devices, variables, programs, and scenes on an ISY controller.
After connecting to the ISY, the 4 types (device, scenes, programs, and variables) of items on the ISY are enumerated. The event handler generates 'add' events are items are discovered. Each item has properties that generate 'property' events as they are changed.
Currently supports Insteon dimmers, switches, keypadlincs, fanlincs, templinc and contact devices ZWave locks and switches ISY Scenes ISY Programs ISY Variables
All item/node types (device,scene,program,variable) are retrieved and updated via websockets. No polling.
Each device has a common base class so that the user does not need to aware of the technology (Insteon/zWave etc) to use that device
Designed to be easy to expand support to other ISY device types and technologies such as zWave.
Requires 5.xx firmware. Tested against 5.16. Chunked can be on or off.
An event handler is supplied when the controller is started. All device events (add, remove, property) can be captured through the event handler for processing as needed.
This library is used in IYS994-Homie-Bridge, an MQTT Client to serve ISY devices to a MQTT broker using the Homie 3/4 protocol.
Example usage: The program below connects to the ISY and enumerates all items. If it finds a device with the address specified, it will flash that device on and off every 2 seconds
import time
from isy994.controller import Controller
url = '192.168.1.213'
#url = None # use autodiscovery
dimmer_address = '42 C8 99 1' # dimmer to flash on/off
dimmer = None
def isy_event_handler(container,item,event,*args):
print ('Event {} from {}: {} {}'.format(event,container.container_type,item.name,*args))
if container.container_type == 'Device' and event == 'add' and item.address == dimmer_address:
global dimmer
dimmer = item
try:
c = Controller(url,username='admin',password='admin',use_https=False,event_handler=isy_event_handler)
while True:
if dimmer is not None:
dimmer.set_level (0)
time.sleep(2)
if dimmer is not None:
dimmer.set_level (100)
except KeyboardInterrupt:
print("KeyboardInterrupt has been caught.")
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
Built Distribution
File details
Details for the file ISY994v5-0.9.7.tar.gz
.
File metadata
- Download URL: ISY994v5-0.9.7.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39c02283710b4231035c53d8cb6e628d84b82f3b8396e9872480e83dbecdc423 |
|
MD5 | 70135092520690985de5a54ca41631ec |
|
BLAKE2b-256 | d7debcb4a3f26a6a7171133e49a9555b0bb198b206ac30b520424e1b173d9858 |
File details
Details for the file ISY994v5-0.9.7-py3-none-any.whl
.
File metadata
- Download URL: ISY994v5-0.9.7-py3-none-any.whl
- Upload date:
- Size: 46.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c767ce643d86c97fe113f09f65bf567492757749a865911989a714ed4cd3c56 |
|
MD5 | 78df1913d2cfdf0c3a0137fb1d702141 |
|
BLAKE2b-256 | 56d12dc507a36a789a4ba15b175e09cb06c081831b39280004dd3faa40c77d53 |