Skip to main content

asyncio Python library for connecting to and controlling the Logitech Harmony

Project description

Python library for programmatically using a Logitech Harmony Link or Ultimate Hub.

This library originated from iandday/pyharmony which was a fork of bkanuka/pyharmony with the intent to:

  • Make the harmony library asyncio

  • Ability to provide one’s own custom callbacks to be called

  • Automatic reconnect, even if re-connection cannot be established for a time

  • More easily get the HUB configuration through API call

  • Additional callbacks: connect, disconnect, HUB configuration updated

  • Using unique msgid’s ensuring that responses from the HUB are correctly managed.

Protocol

As the harmony protocol is being worked out, notes will be in PROTOCOL.md.

Status

  • Retrieving current activity

  • Querying for entire device information

  • Querying for activity information only

  • Querying for current activity

  • Starting Activity

  • Sending Command

  • Changing channels

  • Custom callbacks.

Usage

usage: __main__.py [-h] (--harmony_ip HARMONY_IP | --discover)
                   [--protocol {WEBSOCKETS,XMPP}]
                   [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                   [--logmodules LOGMODULES]
                   [--show_responses | --no-show_responses] [--wait WAIT]
                   {show_config,show_detailed_config,show_current_activity,start_activity,power_off,sync,listen,activity_monitor,send_command,change_channel}
                   ...

aioharmony - Harmony device control

positional arguments:
  {show_config,show_detailed_config,show_current_activity,start_activity,power_off,sync,listen,activity_monitor,send_command,change_channel}
    show_config         Print the Harmony device configuration.
    show_detailed_config
                        Print the detailed Harmony device configuration.
    show_current_activity
                        Print the current activity config.
    start_activity      Switch to a different activity.
    power_off           Stop the activity.
    sync                Sync the harmony.
    listen              Output everything HUB sends out. Use in combination
                        with --wait.
    activity_monitor    Monitor and show when an activity is changing. Use in
                        combination with --wait to keep monitoring
                        foractivities otherwise only current activity will be
                        shown.
    send_command        Send a simple command.
    send_commands       Send a series of simple commands separated by spaces.
    change_channel      Change the channel

optional arguments:
  -h, --help            show this help message and exit
  --harmony_ip HARMONY_IP
                        IP Address of the Harmony device, multiple IPs can be
                        specified as a comma separated list without spaces.
                        (default: None)
  --discover            Scan for Harmony devices. (default: False)
  --protocol {WEBSOCKETS,XMPP}
                        Protocol to use to connect to HUB. Note for XMPP one
                        has to ensure that XMPP is enabledon the hub.
                        (default: None)
  --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level for all components to print to the
                        console. (default: ERROR)
  --logmodules LOGMODULES
                        Restrict logging to modules specified. Multiple can be
                        provided as a comma separated list without any spaces.
                        Use * to include any further submodules. (default:
                        None)
  --show_responses      Print out responses coming from HUB. (default: False)
  --no-show_responses   Do not print responses coming from HUB. (default:
                        False)
  --wait WAIT           How long to wait in seconds after completion, useful
                        in combination with --show-responses. Use -1 to wait
                        infinite, otherwise has to be a positive number.
                        (default: 0)

Release Notes

See changelog <https://github.com/Harmony-Libs/aioharmony/blob/main/CHANGELOG.md> for release notes

TODO

  • Redo discovery for asyncio. This will be done once XMPP is re-implemented by Logitech

  • More items can be done from the Harmony iOS app; determining what could be done within the library as well

  • Is it possible to update device configuration?

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

aioharmony-0.5.2.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

aioharmony-0.5.2-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

Details for the file aioharmony-0.5.2.tar.gz.

File metadata

  • Download URL: aioharmony-0.5.2.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aioharmony-0.5.2.tar.gz
Algorithm Hash digest
SHA256 3e55ed7ee2e6899de4e4e4ccf1cb22c91ab214bbc1299a06a738e2f05eff7ca5
MD5 39441d57af5e91dc6748ce6ef8019055
BLAKE2b-256 cb6e99b2ea0ce45a2979386dfa8ebd7da0e6e7282e2ac1aee06fec7be8bbfd93

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioharmony-0.5.2.tar.gz:

Publisher: ci.yml on Harmony-Libs/aioharmony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aioharmony-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: aioharmony-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 39.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for aioharmony-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 36217439261be51894dc271157a65948daf93ca2cfb7a2e9e1dcd6e59e2acd6e
MD5 7662125d72572e443cf1d93a7e1ab8ee
BLAKE2b-256 805b3a6b2742df52f08b9b24a36ead85a35eddfc014ebdf3a0de4d10616530b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioharmony-0.5.2-py3-none-any.whl:

Publisher: ci.yml on Harmony-Libs/aioharmony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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