python api for digitalSTROM
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
pydigitalstrom
tests
.coveragerc
.editorconfig
.gitignore
.travis.yml
CHANGELOG.md
Dockerfile
LICENSE
MANIFEST.in
README.md
docker-compose.yaml
requirements.txt
requirements_test.txt
setup.cfg
setup.py
tox.ini

README.md

PyPI version Travis CI build status Coverage Status MIT Licence

pydigitalstrom

Run bundled docker

$ docker-compose build

$ docker-compose up -d

$ docker-compose exec python bash

Status

Tested devices

Device name Color group / device type Features
GE-KL200 Yellow (light) get status, turn on, turn off, toggle, identify, update status
GE-KM200 Yellow (light) get status, get brightness, turn on, turn off, toggle, identify, set brightness (if output mode permits), update status/brightness
GR-KL200 Grey (blinds) set position, get position, update position
SW-ZW200-F Black (joker) (adaptor plug) get status, turn on, turn off, toggle, update status
SW-TKM200 Black (joker) (push button) get status, update status
dSM12 Meter get metadata, get current power consumption, get overall power consumption, update metadata/power consumption
dSS IP Server get metadata, update metadata
Scene Meta turn on, turn off

Example usage

# -*- coding: UTF-8 -*-
import urllib3
import os

from pydigitalstrom.client import DSClient

# disable certificate warnings - dss uses self signed
async def test():
    urllib3.disable_warnings()
    config_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config', 'auth.json')
    client = DSClient(host='https://dss.local:8080', username='dssadmin', password='mySuperSecretPassword',
                      config_path=config_path, apartment_name='Apartment')
    await client.initialize()
    lights = client.get_lights()
    for light in lights.values():
        print(light.name)
        print(light.unique_id)
        await light.turn_on()