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", set_groups_and_scenes=True)

Note that setting the groups and scenes will do a network call to the Qsync bridge. This is an optional step that sets those sub-objects into the Qsync object. For control of groups and scenes you do not need to do the set_groups_and_scenes call, assuming you already know your channel number or scene name.

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.1.0.tar.gz (8.1 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.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qmotion-qsync-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 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.1.0.tar.gz
Algorithm Hash digest
SHA256 37a75ea745e49104c9e8bb299073df2c90929192c78acefe43ef20765c8f8ca5
MD5 ad3668c746a496868d06dbee31990ba6
BLAKE2b-256 bc239695d55f27abd87a5da0fb69cb2d27ae1a61728048016e964316530a1abf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qmotion_qsync-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a21a3dab7f7ef514880793c1feffbc31bca5f677f5a5de74e27e0dde084bf8b
MD5 a8eeab024c1874a950207bc877186a51
BLAKE2b-256 de8114a331a80c09f36445cd4ee83776d5c04053e66ea30b042c6a377de007f7

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