Virtual HomeMatic CCU XML-RPC backend.
Project description
pydevccu
Virtual HomeMatic CCU XML-RPC Server with fake devices for development.
If you develop applications that communicate with a CCU (or Homegear) via XML-RPC, you can use this server instead of a real CCU. It currently provides all HomeMatic Wired and HomeMatic Wireless devices (allthough some devices with multiple similar channels with just a single channel). HomeMatic IP devices will follow.
The main objective is to provide you access to all available devices without owning them, as well as not stressing your CCU / messing with your devices while testing your work. It should also be possible to use this for automated testing / CI.
The init
method used to subscribe to events is available and functional. Events will be fired when you use the setValue
or putParamset
methods to change parameters of a device.
When adding the logic
argument while creating the server-object, modules found in device_logic will be loaded depending on which devices are enabled. For example: the module HM_Sec_SC_2.py fires two events at the specified interval. The STATE
toggles with every event, and LOWBAT
gets toggled every 5 events.
The startupdelay randomizes when the eventloop will initially start from 0 to startupdelay seconds. This is to prevent multiple devices from firing their events at the same time.
Methods
setValue(address, value_key, value, force=False)
getValue(address, value_key)
getDeviceDescription(address)
getParamsetDesctiption(address, paramset_key)
getParamset(address, paramset_key)
(Themode
argument of a real CCU is not supported)putParamset(address, paramset_key, paramset, force=False)
(Therx_mode
argument of a real CCU is not supported)listDevices()
init(url, interface_id)
getServiceMessages()
(Returns dummy-error)supportedDevices()
(Proprietary,dict
of supported devices)addDevices(devices)
(Proprietary, add additional devices during runtime.devices
is a list of device names, like when initializing the server)removeDevices(devices)
(Proprietary, remove devices during runtime.devices
is a list of device names, like when initializing the server)
For more information about the methods refer to the official HomeMatic XML-RPC API (german).
Usage
import pydevccu
# Create server that listens on 127.0.0.1:2001
# To listen on another address initialize with ("1.2.3.4", 1234) as first argument
# Add optional list of device names to only load these devices
# Enable paramset persistance (will be saved to paramset_db.json)
# Enable automated device logic (only if module for device is available), firing events at intervals of 30 seconds
s = pydevccu.Server(devices=['HM-Sec-WDS', 'HM-Sen-MDIR-WM55', 'HM-Sec-SC-2'], persistance=True, logic={"startupdelay": 5, "interval": 30})
# Start server
s.start()
# Get address for a HM-Sec-WDS device
s.supportedDevices()['HM-Sec-WDS']
# Get device description
s.getDeviceDescription('VCU0000348')
# Get VALUES paramset for channel 1
s.getParamsetDescription('VCU0000348:1', 'VALUES')
# Get current state
s.getValue('VCU0000348:1', 'STATE')
# Set state to 2
# Set force=True because parameter does not allow write operations (it's a sensor updated by hardware in real life)
s.setValue('VCU0000348:1', 'STATE', 2, force=True)
# Set state to 1 using the putParamset method
s.putParamset('VCU0000348:1', 'VALUES', {'STATE': 1}, force=True)
# Trigger PRESS_SHORT event for HM-Sen-MDIR-WM55 on channel 2
s.setValue("VCU0000274:2", "PRESS_SHORT", True)
# Add a HM-CC-RT-DN device during runtime
s.addDevices(devices=['HM-CC-RT-DN'])
# Remove the HM-Sec-SC-2
s.removeDevices(devices=['HM-Sec-SC-2'])
# Stop server
s.stop()
Installation
pip install pydevccu
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 pydevccu-0.1.11.tar.gz
.
File metadata
- Download URL: pydevccu-0.1.11.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
faebee62650ba588a73f0e6a4c02c39e016a442c7a97e2cf81a20d7dd9af49a8
|
|
MD5 |
4008132c1d48a4ecae220da519ef0a9b
|
|
BLAKE2b-256 |
aa1a7cdf893861a2cec6ad8fc0ff904b0a3a841aff78ff6c6ec44cdd90adde4d
|
Provenance
The following attestation bundles were made for pydevccu-0.1.11.tar.gz
:
Publisher:
python-publish.yml
on SukramJ/pydevccu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pydevccu-0.1.11.tar.gz
-
Subject digest:
faebee62650ba588a73f0e6a4c02c39e016a442c7a97e2cf81a20d7dd9af49a8
- Sigstore transparency entry: 226920827
- Sigstore integration time:
-
Permalink:
SukramJ/pydevccu@1cd2985cb316914959dcf4c59e1328e0e5acb87f
-
Branch / Tag:
refs/tags/0.1.11
- Owner: https://github.com/SukramJ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-publish.yml@1cd2985cb316914959dcf4c59e1328e0e5acb87f
-
Trigger Event:
release
-
Statement type:
File details
Details for the file pydevccu-0.1.11-py3-none-any.whl
.
File metadata
- Download URL: pydevccu-0.1.11-py3-none-any.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
f0232eb0fd0e2db9a902f6b313e5f749020819ce8361510d9fcda9f6aa3caa10
|
|
MD5 |
08624a8b83a5bd0eb96f544a6438a97c
|
|
BLAKE2b-256 |
c670b8bd8fefb3b021d9529934742a3f2c28a1d084d7179858499cb1b1b84ec9
|
Provenance
The following attestation bundles were made for pydevccu-0.1.11-py3-none-any.whl
:
Publisher:
python-publish.yml
on SukramJ/pydevccu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pydevccu-0.1.11-py3-none-any.whl
-
Subject digest:
f0232eb0fd0e2db9a902f6b313e5f749020819ce8361510d9fcda9f6aa3caa10
- Sigstore transparency entry: 226920828
- Sigstore integration time:
-
Permalink:
SukramJ/pydevccu@1cd2985cb316914959dcf4c59e1328e0e5acb87f
-
Branch / Tag:
refs/tags/0.1.11
- Owner: https://github.com/SukramJ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-publish.yml@1cd2985cb316914959dcf4c59e1328e0e5acb87f
-
Trigger Event:
release
-
Statement type: