Skip to main content

Provides an API for requesting information from an Openhome device

Project description


Library to provide an API to an existing openhome device. The device needs to have been discovered first by something like netdisco (


pip install openhomedevice






    SetStandby(standbyRequested) #bool
    Play() #starts playback
    PlayMedia(track_details) #start playing `track_details`
    Stop() #stops playback
    Pause() #pauses playback
    Skip(offset) #positive or negative integer
    SetVolumeLevel(volumeLevel) #positive number
    IncreaseVolume() #increase volume by 1
    DecreaseVolume() #decrease volume by 1
    SetMute(muteRequested) #bool
    SetSource(index) #positive integer (use Sources() for indices)
    InvokePin(index) #positive integer (use Pins() for indices)


    GetConfigurationKeys() # returns an array of configurable keys
    SetConfiguration(key, value) #set a configuration key to a specific value
    GetConfiguration(key) #returns the value of the configuration key


    Uuid() #Unique identifier
    Name() #Name of device
    Room() #Name of room
    IsInStandby() #returns true if in standby
    TransportState() #returns one of Stopped, Playing, Paused or Buffering.
    VolumeEnabled() #returns true if the volume service is available
    VolumeLevel() #returns the volume setting or None if disabled
    IsMuted() #returns true if muted or None if disabled
    Source() #returns the currently connected source as a dictionary
    Sources() #returns an array of source dictionaries with indices
    TrackInfo() #returns a track dictionary
    Pins() #returns an array of pin dictionaries with indices
Source Response
    'type': 'Playlist',
    'name': 'Playlist'
Sources Response
    { 'index': 0, 'type': 'Playlist', 'name': 'Playlist' },
    { 'index': 1, 'type': 'Radio', 'name': 'Radio' },
    { 'index': 3, 'type': 'Receiver', 'name': 'Songcast' },
    { 'index': 6, 'type': 'Analog', 'name': 'Front Aux' }
Pins Response
  {'index': 1, 'title': 'Playstation 4'}
  {'index': 4, 'title': 'Classic FM'}
  {'index': 6, 'title': 'Chillout Playlist'}
TrackInfo Response
  "mimeType": "http-get:*:audio/x-flac:DLNA.ORG_OP=01;DLNA.ORG_FLAGS=01700000000000000000000000000000",
  "rating": None,
  "performer": [
    "Fahmi Alqhai, Performer - Johann Sebastian Bach, Composer"
  "bitDepth": 16,
  "channels": 2,
  "disc": None,
  "composer": [],
  "year": 2017,
  "duration": 460,
  "author": [],
  "albumArtist": [],
  "type": "object.item.audioItem.musicTrack",
  "narrator": [],
  "description": None,
  "conductor": [],
  "albumArtwork": "",
  "track": 2,
  "tracks": None,
  "artwork": None,
  "genre": [
  "publisher": "Glossa",
  "albumGenre": [
  "artist": [
    "Fahmi Alqhai"
  "bitRate": None,
  "albumTitle": "The Bach Album",
  "uri": "",
  "discs": None,
  "published": None,
  "title": "Violin Sonata No. 2 in A Minor, BWV 1003 (Arr. for Viola da gamba) : Violin Sonata No. 2 in A Minor, BWV 1003 (Arr. for Viola da gamba): II. Fuga",
  "sampleRate": 44100
Playing A Track

Use this to play a short audio track, a podcast Uri or radio station Uri. The audio will be played using the radio source of the device. The trackDetails object should be the same as the one described in the TrackInfo section above.

    trackDetails = {}
    trackDetails["uri"] = ""
    trackDetails["title"] = 'Linn Radio (Eclectic Music)'
    trackDetails["albumArtwork"] = ''



from openhomedevice.Device import Device

if __name__ == '__main__':
    locations = [

    for location in locations:
        openhomeDevice = Device(location)
        print("NAME     : %s" % openhomeDevice.Name())
        print("ROOM     : %s" % openhomeDevice.Room())
        print("UUID     : %s" % openhomeDevice.Uuid())
        print("SOURCE   : %s" % openhomeDevice.Source())
        print("STANDBY  : %s" % openhomeDevice.IsInStandby())
        print("STATE    : %s" % openhomeDevice.TransportState())
        print("TRACK    : %s" % openhomeDevice.TrackInfo())
        print("VOLUME   : %s" % openhomeDevice.VolumeLevel())
        print("MUTED    : %s" % openhomeDevice.IsMuted())
        print("SOURCES  : %s" % openhomeDevice.Sources())
        print("PINS     : %s" % openhomeDevice.Pins())

Running Tests

PYTHONPATH=. pytest ./tests/*

Uploading Package

Following guide from

Update version in

python3 sdist
twine upload dist/*

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

openhomedevice-0.7.1.tar.gz (12.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page