Mobilus Cosmo GTW Client
This code provides a native Python client for the Mobilus Cosmo GTW. It connects directly to the gateway's MQTT broker and sends message commands to control the associated devices. The connection is established locally, so the client must be run on the same network as the gateway. Note: internet access is not required and can be disabled on the device.
In order to use the client, configuration and setup need to be done on the Mobilus Cosmo GTW side. This includes creating a user and pairing the devices with the gateway.
The story behind the reverse engineering of this device, covering both the motivation and the process, is described in this blog post.
Installation
Install the module with pip:
pip install mobilus-client
Usage
For convenience, the client can be run as a module:
python -m mobilus_client --host=GATEWAY_HOST --login=USER_LOGIN --password=USER_PASSWORD COMMANDS
Where:
GATEWAY_HOSTis the IP address of the gateway.USER_LOGINandUSER_PASSWORDare the user credentials to access the gateway.COMMANDSis a list of commands to be sent to the gateway.
Currently, the following commands are supported:
-
current_state- Get the current state of the devices. Please note that in the case of shutters, the state may be delayed, especially when the shutter is controlled by a physical switch. -
devices_list- List all devices that are paired with the gateway. -
call_events:device_id=DEVICE_ID,value=VALUE- Send a command to the device. This can be used for actual control of the device (shutter).DEVICE_ID- The ID of the device as returned from devices_list.VALUE- The value to be sent to the device, currently one of "UP", "DOWN", "STOP", "ON", "OFF", a percentage value like "85%" or "DOWN:60$" (for shutters, with tilt control).
Multiple commands can be sent at once, separated by spaces:
python -m mobilus_client --host=192.168.2.1 --login=admin --password=my_password devices_list call_events:device_id=0,value=100% call_events:device_id=1,value=80%
Output is printed to the console in JSON format, and therefore the client command can be easily chained with jq for prettier output. For example:
python -m mobilus_client --host=192.168.2.1 --login=admin --password=my_password current_state | jq
Verbose mode can be enabled with the --verbose flag:
python -m mobilus_client --host=192.168.2.1 --login=admin --password=my_password --verbose current_state
Caveats
The client is tested with Mobilus Cosmo GTW and shutter devices only (COSMO 2WAY). However, it should also work with other devices supported by the Gateway (SENSO, COSMO, CMR, CGR, SWITCH, SWITCH_NP, COSMO_CZR, COSMO_MZR, SENSO_Z). The purpose of the client is to provide a simple way to control the devices without the need to use the official Mobilus Cosmo GTW web interface or app, and to integrate it with open-source systems like Home Assistant. I am not affiliated with Mobilus, and the client is provided as is.
Development
Clone the repository and navigate to the project directory. Install the package in editable mode with the following command:
pip install -e .[test]
Check mypy and ruff with the following commands:
mypy .
ruff check
The tests can be run with the following command:
python -m unittest -v
To generate a coverage report:
coverage run -m unittest discover
coverage report -m
To regenerate proto files
docker-compose up --build -f scripts/docker-compose.yml
Metadata
Release files for mobilus-client 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mobilus_client-0.2.1.tar.gz | 12.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mobilus_client-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.0 kB
Release files / mobilus_client-0.2.1.tar.gz
| Download URL | mobilus_client-0.2.1.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eeb2a11af1b9b7123074a404b190d541e9c47113b1e8cfa61f0fc22e1b872937
|
|
BLAKE2b-256 checksum How to use checksums |
06ca46cb6900d8f140250ce357676f082178a5b9daf82d15f5dc0d89694d1dcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 20, 2026.
Transparency logRelease files / mobilus_client-0.2.1-py3-none-any.whl
| Download URL | mobilus_client-0.2.1-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94892c18a370120e3515b9b1a589bcdc5a70e164566d0624df74244cd98a6a26
|
|
BLAKE2b-256 checksum How to use checksums |
d5650c74cb00d964dbe43ee71f2e890bb19bd456ed0fc5285c30cea4286d8d06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 20, 2026.
Transparency logSecurity for mobilus-client 0.2.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mobilus_client-0.2.1.tar.gz
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 Jun 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.