Skip to main content

Control Qmotion Gen2 shades using Qsync device

Project description

Qmotion-qsync

This package controls Qmotion shades using a Qsync bridge device.

The protocol is reverse engineered by inspecting network packets, with credit to devbobo and exitexit.

Note that the Qsync must be installed and set up using the Qsync application before usage - this package provides no support for creating the groups and scenes involved in control.

Also note that there is no state in this system - all commands are fire and forget, with no returned data to see if the shade successfully received the command. Therefore, Qsync appears to retry commands multiple times in the hope that shades will (eventually) receive the command. This can make multiple serial commands problematic, see Groups below for more information. If you are having difficulty having shades respond to commands, look into Qsync physical location and possibly introduce Qrelay device(s). In my experience, problematic shades rarely respond better to repeated commands sent over this protocol.

Usage

Discovery

Qsync bridges can be discovered on the network using UDP broadcast:

import qmotion_qsync

qsync = qmotion_qsync.discover_qsync()

If a Qsync device can be found on the network, a full-populated Qsync class will be returned.

Alternatively, you can not use discovery and define the Qsync device manually:

from qmotion_qsync import Qsync

qsync = Qsync("192.168.1.2")

Note: While still fully usable for control, this Qsync object will NOT be fully populated. Some details are only available using UDP discovery (for example the Qsync name). Groups and scenes can be sepearately fetched from the Qsync class using getScenesAndGroups.

Group control

Qsync uses the concept of shade groups and are configured in the Qsync app. These groups can be a single shade (recommended for fine-grained control) or groups of shades. Note that a single shade can be in multiple groups, so you can have both fine grain control and bulk shade movement using groups effectively. The group -> shade mapping not stored in Qsync, and therefore this module has no knowledge of which shades are in which groups. Instead, shades "listen" for group numbers they are configured to be involved in and react accordingly. Up to eight shade groups can be controlled at the same time.

Repeated commands are problematic - the Qsync device appears to be fairly easily confused, plus commands appear to be repeated by the Qsync device and take a while to act upon. Therefore, I don't recommend individual controls of groups - it is better to use one command with a number of groups all at same time. That is, better to issue one request for eight commands than call this module eight times with individual commands.

from qmotion_qsync import Qsync, ShadeGroup, ShadeGroupCommand

qsync = Qsync("192.168.1.2")
# Move shade group 20 to percent 25 (1/4 closed - so mostly open) and shade group 18 to half closed
qsync.set_group_position([ShadeGroupCommand(ShadeGroup(20), 25), 
	ShadeGroupCommand(ShadeGroup(18), 50)])

Scene control

Qsync allows for scenes as well. A scene is the same as a group, in that it is up to eight shade groups that can be controlled at the same time to (possibly) different positions. The difference is the shade groups and percent for each group is pre-stored in the Qsync bridge. To call a scene, you use the text description of the scene, and the module will go look up what is stored for that scene and then set the shade groups appropriately.

from qmotion_qsync import Qsync

qsync = Qsync("192.168.1.2")
qsync.set_scene("Family Room Down")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qmotion-qsync-0.0.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qmotion_qsync-0.0.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file qmotion-qsync-0.0.1.tar.gz.

File metadata

  • Download URL: qmotion-qsync-0.0.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.7.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.3

File hashes

Hashes for qmotion-qsync-0.0.1.tar.gz
Algorithm Hash digest
SHA256 889e611874f7c00f800493adc6b08599e11aea08a761398d30da7fc636fbf177
MD5 3c13b1c00b9d343e3fc2c51c691589d9
BLAKE2b-256 3b4535da9539cc16fd8c51db03d85621eba9607a5b639822b4d8f073955f65ad

See more details on using hashes here.

File details

Details for the file qmotion_qsync-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: qmotion_qsync-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.7.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.3

File hashes

Hashes for qmotion_qsync-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 69d59eb5091256dd3fcd1130c2bac16a739cfd01bb6cd761878449fa5c1efc8b
MD5 8e07ed7238f26ca5a7403ae2d7f66e99
BLAKE2b-256 2c32b4e3051f8e7a297e7f818b0bd95166e76e4af9fcbc052a4c24f2d927333e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page