jointSPACE Ambilight control using Python

T. Wolf
  • T. Wolf
    T. Wolf


    I'm currently developing a media center solution based on Python. I'm using UPnP to detect TPVision Philips TVs on the local network and control its state based on the time. This way I'm able to switch it off during day and switch it on in the evening.

    I looked at the binary (DirectFB Voodoo based protocol) but wasn't able to find any specification / documentation beside the source code at

    Do you know any documentation to get started with a native Python client library? Does a media center supporting Philips Ambilight and DLNA sound interesting?

    I look forward to your feedback.

    Btw.: If you want to test it on your system, I packed a release (please note that its pre-alpha). You can download it the tar.gz or ZIP file and unpack it.

    Prerequisites: Windows (untested) or Linux OS (maybe also MacOS) with Python 2.7+ or 3.3+ installed.

  • T. Wolf
    T. Wolf

    I missed to mention that there is no README or INSTALL file in the archive. You can start the server with the scripts/ script. It supports a parameter "-stop" to close the running instance (takes up to 30 seconds). The firewall must be configured to accept incoming UDP packets for port 1900 (destination address and outgoing TCP connections to your TV with port 1925.

    2011+ models should work

  • Matthias Ihmig
    Matthias Ihmig

    A native Python library for DNLA Does sound interesting - I'd like to start playing an .avi or .mkv by from my PC through double-click - a python software which is executed with the avi-file as parameter and integrating a simple "run-on-demand" UPnP media-server to serve the file and a UPnP control point to start/stop playing would be perfect for this.

    So much said, here's how far I understand the Jointspace API:
    (I only own a 2k11 device, so I can only speak for these. If anyone has some additional information on other devices, please complete.
    So far, I have unfortunately not heard from anyone using Jointspace JSON on a 2k12 or a 2k13 TV).

    There are three (independent) interfaces on the 2k11 TVs:

    1. Remote Control through UPnP (UDP port 1900 and TCP port 2869):
      - start playback from an URI source
      - basic control such as play, pause, stop, set Volume
      - Unfortunately no remote skipping/seeking, but please correct me if I'm wrong

    2. Complex Remote control and basic drawing interface (aka Jointspace) through DirectFB VooDoo (port 2323):
      - draw boxes, text and images on screen as overlay through DirectFB
      - press remote control buttons using jslibrc_KeyDown through jslibrc (Send IDivine event)
      - activate TV applications (Home, NetTV, BrowseUSB, BrowseDLNA, WatchTV, Teletext, Epg, RemoteApp)
      - receive remote control button events (but only if the "RemoteApp" drawing application is active on the TV) through IDirectFBEventBuffer DWET_KEYDOWN event

    3. Simple Remote control through JSON using HTTP (port 1925), not available on 2k10 TVs
      - Get TV channel list and other TV information
      - select current TV channel and input
      - press remote control buttons
      - Control ambilight

    This list (also the features and what is possible for each interface) may not complete,
    it's just based on what I've seen working. Feel free to complete!

    If someone tries these on a >2k11 TV, please let us know what works and what doesn't.

    I'm not aware of any good DirectFB documentation for starting, but you're looking for a way to get started to implement features from (2.) natively in Python, have a look at how and in which order the necessary DirectFB commands are executed.

    A reasonably simple yet complete example to start with this is JSTx (also on sourcefourge).
    You could compile this with debugging information and step through the code. Maybe it's helpful to use wireshark to find out how the packets sent through port 2323 are built up, and use this to make a (simplified and stripped down) python-only version without DirectFB dependencies.

    Have fun!

  • T. Wolf
    T. Wolf

    I think it would problematic to start a playback for files given at the command line. If you have more than one device you would need to define a "default playback" device.

    But I like your idea and maybe it would be great to add files to a virtual UPnP content directory for "Favorites". This way you can navigate to the file much faster.