Awesome Open Source
Awesome Open Source


Build Status Documentation Status pip version License Last Commit Contributions Language grade: Python Language grade: JavaScript

  • Recommended read: Getting started with Platypush.

  • The blog is in general a good place to get more insights on what you can build with it and inspiration about possible usages.

  • The wiki also contains many resources on getting started.

  • Extensive documentation for all the available integrations and messages is available.

  • If you have issues/feature requests/enhancement ideas please create an issue.

  • A Reddit channel is also available for more general questions.

Platypush is a general-purpose extensible platform for automation and integration across multiple services and devices.

It enables users to create their own self-hosted pieces of automation based on events (if this happens then do that) and it provides a comprehensive and customizable user interface that collects everything you need to visualize and control under one roof.

It takes some concepts from IFTTT, Tasker, Microsoft Flow, PushBullet and Home Assistant to provide an environment where the user can easily connect things together.

Its ideal home is a single-board computer like a RaspberryPi that you can configure to orchestrate any home automation and cloud automation in your own living room or garage, but it can easily run on any device that can run a Python interpreter, and the bar for the hardware requirements is very low as well - I use it to run pieces of automation on devices as powerful as a RaspberryPi Zero or an old Nokia N900 with Linux.

You can use Platypush to do things like:


The architecture of Platypush consists of a few simple pieces, orchestrated by a configuration file stored by default under ~/.config/platypush/config.yaml:


They are integrations that do things - like modify files, train and evaluate machine learning models, control cameras, read sensors, parse a web page, control lights, send emails, control Chromecasts, run voice queries, handle torrent transfers or control Zigbee or Z-Wave devices.

The configuration of a plugin matches one-on-one that of its documented class constructor, so it's very straightforward to write a configuration for a plugin by reading its documentation:

  # Groups that will be controlled by default
    - Living Room
    - Hall


Plugins expose actions, that match one-on-one the plugin class methods denoted by @action, so it's very straightforward to invoke plugin actions by just reading the plugin documentation. They can be invoked directly from your own scripts or they can be sent to the platform through any supported channel as simple JSON messages:

  "type": "request",
  "action": "light.hue.on",
  "args": {
    "lights": ["Entrance Bulb"]


They are background services that either listen for messages on channels (like an HTTP backend, an MQTT instance, a Kafka instance, a Websocket service, Pushbullet etc.) or monitor a device or a service for events (like a sensor, a custom voice assistant, a bridge running on a Zigbee or Z-Wave, an NFC card reader, a MIDI device, a Telegram channel, a Bluetooth scanner etc.).

If a backend supports the execution of requests (e.g. HTTP, MQTT, Kafka, Websocket and TCP) then you can send requests to these services in JSON format. For example, in the case of the HTTP backend:

# Get a token
curl -XPOST -H 'Content-Type: application/json' -d '
    "username": "$YOUR_USER",
    "password": "$YOUR_PASSWORD"
  }' http://host:8008/auth

# Execute a request

curl -XPOST -H 'Content-Type: application/json' -H "Authorization: Bearer $YOUR_TOKEN" -d '
    "type": "request",
    "action": "tts.say",
    "args": {
      "text": "This is a test"
  }' http://host:8008/execute


When a certain event occurs (e.g. a JSON request is received, or a Bluetooth device is connected, or a Flic button is pressed, or some speech is detected on the voice assistant service, or an RSS feed has new items, or a new email is received, or a new track is played, or an NFC tag is detected, or new sensor data is available, or a value of a Zigbee device changes, etc.), the associated backend will trigger an event.


Event hooks are custom pieces of logic that will be run when a certain event is triggered. Hooks are the glue that connects events to actions, exposing a paradigm similar to IFTTT (if a certain event happens then run these actions). They can declared as:

    type: platypush.message.event.assistant.SpeechRecognizedEvent
    phrase: "play ${title} by ${artist}"
    - action: music.mpd.clear
    - action:
          artist: ${artist}
          title: ${title}

    - if ${len(output)}:
      - action:
          resource: ${output[0]['file']}
  • Stand-alone Python scripts stored under ~/.config/platypush/scripts and will be dynamically imported at start time. Example:
from platypush.event.hook import hook
from platypush.utils import run
from platypush.message.event.assistant import SpeechRecognizedEvent

@hook(SpeechRecognizedEvent, phrase='play ${title} by ${artist}')
def on_music_play_command(event, title=None, artist=None, **context):
  results = run('', filter={
    'artist': artist,
    'title': title,

  if results:
    run('', results[0]['file'])


Procedures are pieces of custom logic that can be executed as atomic actions using procedure.<name> as an action name. They can be defined either in the config.yaml or as Python scripts stored under ~/.config/platypush/scripts - provided that the procedure is also imported in ~/.config/platypush/scripts/ so it can be discovered by the service.

YAML example for a procedure that can be executed when we arrive home and turns on the lights if the luminosity is lower that a certain thresholds, says a welcome home message using the TTS engine and starts playing the music:

    # Get luminosity data from a sensor - e.g. LTR559
    - action: gpio.sensor.ltr559.get_data

    # If it's lower than a certain threshold, turn on the lights
    - if ${int(light or 0) < 110}:
        - action: light.hue.on

    # Say a welcome home message
    - action:
        text: Welcome home

    # Play the music
    - action:

Python example:

# Content of ~/.config/platypush/scripts/
from platypush.procedure import procedure
from platypush.utils import run

def at_home(**context):
  sensor_data = run('gpio.sensor.ltr559.get_data')
  if sensor_data['light'] < 110:

  run('', text='Welcome home')

In either case, you can easily trigger the at-home procedure by sending an action request message to a backend - for example, over the HTTP backend:

curl -XPOST -H 'Content-Type: application/json' -H "Authorization: Bearer $YOUR_TOKEN" -d '
    "type": "request",
    "action": "procedure.at_home"
  }' http://host:8008/execute


Cronjobs are pieces of logic that will be run at regular intervals, expressed in crontab-compatible syntax. They can be defined either in the config.yaml or as Python scripts stored under ~/.config/platypush/scripts as functions labelled by the @cron decorator.

Note that seconds are also supported (unlike the standard crontab definition), but, for back-compatibility with the standard crontab format, they are at the end of the cron expression, so the expression is actually in the format <minute> <hour> <day_of_month> <month> <day_of_week> <second>.

YAML example for a cronjob that is executed every 30 seconds and checks if a Bluetooth device is nearby:

  cron_expression: '* * * * * */30'
    - action: bluetooth.lookup_name
        addr: XX:XX:XX:XX:XX:XX

    - if ${name}:
        - action: procedure.on_device_on
    - else:
        - action: procedure.on_device_off

Python example:

# Content of ~/.config/platypush/scripts/
from platypush.cron import cron
from platypush.utils import run

@cron('* * * * * */30')
def check_bt_device(**context):
  name = run('bluetooth.lookup_name').get('name')
  if name:
    # on_device_on logic here
    # on_device_off logic here

The web interface

If backend.http is enabled then a web interface will be provided by default on http://host:8008/. Besides using the /execute endpoint for running requests, the built-in web server also provides a full-featured interface that groups together the controls for most of the plugins - e.g. sensors, switches, music controls and search, media library and torrent management, lights, Zigbee/Z-Wave devices and so on. The UI is responsive and mobile-friendly.

The web service also provides means for the user to create custom dashboards that can be used to show information from multiple sources on a large screen.


System installation

Platypush uses Redis to deliver and store requests and temporary messages:

# Example for Debian-based distributions
[sudo] apt-get install redis-server

# Enable and start the service
[sudo] systemctl enable redis
[sudo] systemctl start redis

To install the core platform:

  • The pip way:
[sudo] pip3 install platypush
  • The sources way:
git clone
cd platypush
[sudo] python3 install

Then install the extensions that you wish to use. There are a few ways to check the dependencies required by an extension:

Check their extras name in extras_require under

If you follow this route then you can install the extra dependencies in one of the following ways:

  1. pip installation:
[sudo] pip3 install 'platypush[extra1,extra2,extra3]'
  1. Sources installation:
[sudo] pip3 install '.[extra1,extra2,extra3]'

Check the dependencies/installation instructions reported under the plugin/backend documentation.

If you follow this route then simply run the commands listed in the plugin/backend documentation to get the dependencies installed.

Check/uncomment the associated lines in requirements.txt.

If you follow this route then uncomment the lines in requirements.txt associated to the plugins/backends that you want to use and run:

[sudo] pip3 install -r requirements.txt

After installing the dependencies, create a configuration file under ~/.config/platypush/config.yaml (the application can load the configuration from another location through the -c option) containing the configuration of the backend and plugins that you want to use, and add any hooks and procedures for your use case.

You can then start the service by simply running:


It's advised to run it as a systemd service though - simply copy the provided .service file to ~/.config/systemd/user, check if the path of platypush matches the path where it's installed on your system, and start the service via systemctl:

systemctl --user start platypush

Virtual environment installation

Platypush provides a script named platyvenv that can parse a config.yaml and automatically create a virtual environment (under ~/.local/share/platypush/venv/<device_id>) with all the dependencies required by the configured integrations.

  1. Create the environment from a configuration file:
platyvenv build -c /path/to/config.yaml
  1. Start the service from the virtual environment:
# device_id matches either the hostname or the device_id in config.yaml
platyvenv start device_id
  1. Stop the instance:
platyvenv stop device_id
  1. Remove the instance:
platyvenv rm device_id

Docker installation

You can also install Platypush in a container - the application provides a script named platydock that automatically creates a container instance from a config.yaml:

  1. Create the container from a configuration file:
platydock build -c /path/to/config.yaml
  1. Start the container:
# device_id matches either the hostname or the device_id in config.yaml
platydock start device_id
  1. Stop the instance:
platydock stop device_id
  1. Remove the instance:
platydock rm device_id

Mobile app

An official Android app is provided on the F-Droid store. It allows to easily discover and manage multiple Platypush services on a network through the web interface, and it easily brings the power of Platypush to your fingertips.


To run the tests simply run pytest either from the project root folder or the tests/ folder. Or run the following command from the project root folder:

python -m tests


If you use and love Platypush, please consider buying me a coffee/beer.

I've been working on Platypush all by myself in my spare time for the past few years, and I've made sure that it remains open and free.

If you like this product, please consider supporting - I'm definitely not planning to get rich with this project, but I'd love to have at least the costs for the server covered by users.

Issues and requests opened by donors will also be given priority over others.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
python (54,564
automation (725
raspberry-pi (645
iot (580
websocket (479
dashboard (472
mqtt (319
home-automation (219
bluetooth (189
platform (99
sensors (41
voice-assistant (40
zigbee (31
zwave (24