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.2.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.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qmotion-qsync-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e034f609961460272fc8a9165755505ae3036eb78b2ff0a700005a9de370d41c
MD5 ee129e72c3df5be2c154ec70fbd5d486
BLAKE2b-256 45dff537c6e10fe17cb3ff85edd87e009816f72abae45471f32ab809adf60f91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qmotion_qsync-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b9ca39ccd2f50105887a1ad1a87cb581bac0ad7004cca6334fbe7918133adf2
MD5 2ce170627e428613f521a5a3fb520be3
BLAKE2b-256 0f060e72304ab6346505462650712f4291e03cdb79bbcc560e12ed349bb8272f

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