Skip to main content

Asyncio Python library for controlling a Pioneer AVR via its API

Project description

Python library for controlling a Pioneer AVI via its built-in API.

Inspired by the original Pioneer Home Assistant integration. Tested on a VSX-930 (Main Zone and HDZone outputs).

Features

  • Implemented in asyncio.
  • Maintains single continuous telnet session to AVR, with automatic reconnect.
  • Eliminates status polling where AVR sends keepalive responses (on port 8102).
  • Auto-detects Zones 1, 2, 3 and HDZONE.
  • Automatically polls AVR for source names - no longer need to manually code them in your config any more if your AVR supports their retrieval. Can also set source names manually.
  • Ignore specific zones, for AVRs that report phantom zones.
  • Queries device parameters: MAC address, software version, model.
  • Ability to set internal parameters to change the API functionality, eg. maximum volume, volume step change delta.
  • Defaults for internal parameters can be changed based on custom profiles based on AVR model.
  • Includes workaround for AVRs with an initial volume set on the Main Zone (eg. VSX-930).
  • Supports AVRs that do not support setting the volume level by emulating using up/down commands (eg. VSX-S510).
  • Command line client for sending commands and testing

Command line interface (CLI) (>= 0.1.3)

A very simple command line interface aiopioneer is available to connect to the AVR, send commands and receive responses. It can be used to test the capabilities of the library against your specific AVR.

The CLI accepts all API commands, as well as the following:

Command Argument Description
exit or quit Exit the CLI.
zone zone Change current zone to zone.
log_level log_level Change debug level to log_level. Valid log levels are: debug, info, warning, error, critical.
update Request update of AVR. An update is scheduled in the updater task if a scan interval is set, if it is not set then the update is performed synchronously.
update_full Request a full update of AVR irrespective of when the previous update was performed. An update is scheduled in the updater task if a scan interval is set, if it is not set then the update is performed synchronously.
query_device_info Query the AVR for device information.
query_zones Query the AVR for available zones. Ignore zones specified in parameter ignored_zones (list).
build_source_dict Query the sources from the AVR.
set_source_dict sources (JSON) Manually set the sources to sources.
get_source_list Return the current set of available source names that can be used with the select_source command.
get_params Return the currently active set of parameters.
get_user_params Return the currently active set of user parameters.
set_user_params params (JSON) Set the user parameters to params.
debug_listener state (bool) Enable/disable the debug_listener parameter.
debug_responder state (bool) Enable/disable the debug_responder parameter.
debug_updater state (bool) Enable/disable the debug_updater parameter.
debug_command state (bool) Enable/disable the debug_command parameter.
set_scan_interval scan_interval (float) Set the scan interval to scan_interval.
get_scan_interval Return the current scan interval.
set_volume_level volume_level (int) Set the volume level for the current zone.
select_source source_name Set the input source for the current zone.
send_raw_command raw_command Send the raw command raw_command to the AVR.

NOTE: The CLI interface may change in the future, and should not be used in scripts. Use the Python API instead.

Known issues and future plans

  • Document PioneerAVR API

Breaking changes

  • 0.1
    _PioneerAVR.__init__() no longer accepts command_delay, volume_workaround and volume_steps arguments. Configure these parameters using the equivalent PARAM_* keys in the params dict, passed in via the constructure or set via set_user_params().

References

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

aiopioneer-0.1.5.tar.gz (21.8 kB view hashes)

Uploaded Source

Supported by

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