symcon
This python module is for api communication with smarthome software ip-symcon (https://www.symcon.de).
Requires at minimum python 3.6 and ip-symcon 3.0. Some functions may require newer versions.
Codebase
Sourcecode is available on my github page (https://github.com/thorstenMueller/symcon-python/)
Installation
pip install symcon
Usage examples
To establish symcon connection the following properties are required:
- servername
- port (default: 37777)
- protocol (http or https)
- username (or string "token")
- password (or token value)
import symcon
connection = symcon.Symcon("symcon.local",3777,"http","token","123456789")
Execute command in ip-symcon
print("symcon dir: " + connection.execCommand("IPS_GetKernelDir"))
symcon dir: /var/lib/symcon/
Execute script
connection.execScript(36773)
Get variable value
Can return variable value in raw or formatted form (with prefix).
print(connection.getValue(19920,True))
20.4 °C
print(connection.getValue(19920,False))
20.400000000000002
Set variable value
connection.setValue(16412,False)
Request action
Execute default or user defined action script for provided variable id.
connection.requestAction(35615,0.4)
Get object details
print(connection.getObjDetails(32926))
{"ParentID": 0, "ObjectID": 32926, "ObjectType": 1, "ObjectIdent": "", "ObjectName": "Archive Handler", "ObjectInfo": "", "ObjectIcon": "", "ObjectSummary": "", "ObjectPosition": 0, "ObjectIsReadOnly": false, "ObjectIsHidden": false, "ObjectIsDisabled": false, "ObjectIsLocked": false, "HasChildren": false, "ChildrenIDs": []}
Find object by name within parent object
Show id of "Sunrise" object under id 147888 ("Location")
print(connection.getIdByName("Sunrise",14788))
List details on child objects
List objects with details under the provided id
print(connection.getChildsList(20147))
["{\"ParentID\": 14788, \"ObjectID\": 47732, \"ObjectType\": 2, \"ObjectIdent\": \"AstronomicTwilightEnd\", \"ObjectName\": \"Astronimoc twilight end\", \"ObjectInfo\": \"\", \"ObjectIcon\": \"\", \"ObjectSummary\": \"\", \"ObjectPosition\": 8, \"ObjectIsReadOnly\": true, \"ObjectIsHidden\": false, \"ObjectIsDisabled\": false, \"ObjectIsLocked\": false, \"HasChildren\": false, \"ChildrenIDs\": []}"]
Error handling
Following errors on api call will throw an exception:
- http return code <> 200
- error message received by ip-symcon (eg. requested object not found)
Release history
- 2020-09-03: 0.0.1: Initial release
- 2020-09-05: 0.0.2: Added dependency (requests) in setup file for automatic resolve
Metadata
Release files for symcon 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| symcon-0.0.2.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| symcon-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / symcon-0.0.2.tar.gz
| Download URL | symcon-0.0.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e13324db5272734fa9f72eca5f8540aa80ea452f592f395dd5f6671a60f9232
|
|
BLAKE2b-256 checksum How to use checksums |
ac8c840bb2c42b28753e4fc1753dfdf8eebfff5ad33e1165dbbce8e0f958098c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
|
Release files / symcon-0.0.2-py3-none-any.whl
| Download URL | symcon-0.0.2-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a23000a92a1d75af96138d2443d152c633c062180d79b3ea56ed94d1f6181f9
|
|
BLAKE2b-256 checksum How to use checksums |
eb0d266c89271d11744502c90b89ab8657e603efa33d72abde6366e1d17d164b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
|