python-mystrom aka. pystrom
This is an unofficial Python integration for finding and controlling local MyStrom devices.
Due to the lack of owned devices, some features may not be fully implemented or tested. The project is primarily developed and tested with the MyStrom Wi-Fi Switch CH.
[!IMPORTANT]
This project is not developed by MyStrom nor affiliated with them in any way.
Official MyStrom API Documentation: https://api.mystrom.ch/
Want to contribute? Check out the Contributing section below.
Installation
Installation requires Python and Pip (which usually comes with Python).
python -m pip install -U pystrom
Features
This library provides a simple CLI and a Python API.
Console Commands
| Command | Function |
|---|---|
python -m pystrom find |
Listen for MyStrom devices in the local network |
python -m pystrom find --live |
Continuously listen for MyStrom devices in the local network |
Python API
Get device objects
You can use the MyStromDeviceFinder class to find devices in your local network. It will return a list of
MyStromDevice objects or subclasses thereof.
from pystrom.finder import MyStromDeviceFinder
with MyStromDeviceFinder() as finder:
devices = finder.find_all() # will take 5 seconds
for device in devices:
print(device)
You can also create a MyStromDevice object by using the MyStromDeviceFactory.from_ip method, which only requires the
IP address of the device:
from pystrom.device import MyStromDeviceFactory
device = MyStromDeviceFactory.from_ip("192.168.1.220")
print(device)
Control devices
The following API methods are available for controlling devices:
General (MyStromDevice)
| Method | Function |
|---|---|
.get_general_info() |
Get general device information |
.get_wifi_list() |
Get reachable Wi-Fi networks |
.get_help() |
Get a list of available API endpoints |
.get_settings() |
Get current device settings |
.set_settings() |
Set or update device settings |
Switch (MyStromSwitch)
| Method | Function |
|---|---|
.turn_on() |
Turn on the switch |
.turn_off() |
Turn off the switch |
.toggle() |
Toggle the switch state and return the new state |
.power_cycle() |
Power cycle the switch (off, wait, then on) |
.timer() |
Set the state and reverse it after a specified time |
.get_report() |
Get a report of the switch's current state |
.get_temperature() |
Get the current temperature reading and configuration |
Bulb (MyStromBulb)
| Method | Function |
|---|---|
.turn_on() |
Turn on the bulb |
.turn_off() |
Turn off the bulb |
.toggle() |
Toggle the bulb state |
.set_options() |
Set options like color, ramp, mode, and notifyurl |
.get_device_information() |
Get the device information, including current bulb state |
Other devices and missing endpoints
Other device types are not yet implemented with specific classes, but you can still interact with them:
To control them, you can use the manual API methods of the MyStromDevice class, which allows you to send HTTP requests
to the device's API endpoints.
| Method | Function |
|---|---|
.api_get() |
Send a GET request to the device's API endpoint |
.api_post() |
Send a POST request to the device's API endpoint |
Contributing
If you want to contribute to this project, feel free to open an issue or pull request. Contributions are welcome!
- Fork the repository
- Clone your forked repository
python -m pip install -e .[dev]to install the package in editable mode with development dependencies- Install mypy types:
python -m mypy --install-types --non-interactive . - Make your changes
- Format & check your code:
- Format your code with
python -m black . - Check typing with
python -m mypy --strict .
- Format your code with
- Push your changes to your forked repository
- Open a pull request
Metadata
Release files for pystrom 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pystrom-2.1.0.tar.gz | 10.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pystrom-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.0 kB
Release files / pystrom-2.1.0.tar.gz
| Download URL | pystrom-2.1.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
449caf3d48dbd6f2001a1c4f220e18d2a31945f401b4a97f9c107a0e64b76d61
|
|
BLAKE2b-256 checksum How to use checksums |
f8528444b1449dcf3367fbd6929568badacdf84e227b4734852738d9c96b2649
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.
Transparency logRelease files / pystrom-2.1.0-py3-none-any.whl
| Download URL | pystrom-2.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
194118f68ace2860903eafab84b92e260780d8fc2f064e651f2b7bfa215212b5
|
|
BLAKE2b-256 checksum How to use checksums |
d77266b3ff904c6f8787d66771acbd101ee4cedc515bfebbc7210232f6b29d05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.
Transparency log