Python module to controll Orvibo devices, such as s20 wifi sockets and AllOne IR blasters
Switch branches/tags
Nothing to show
Clone or download
Latest commit 33eefd5 Oct 18, 2016
Failed to load latest commit information.
orvibo added RF433 support for Orvibo SmartSwitch only Jul 28, 2016
LICENSE MIT licence added Jan 22, 2016 Update Oct 17, 2016


Module to manipulate Orvibo devices, such as s20 wifi sockets and AllOne IR blasters to control whatever devices via emiting IR signal (TVs, AV receivers, air conditioners, etc)


  • Lots of info was found in ninja-allone library
  • S20 data analysis by anonymous is here
  • python-orvibo similar module, but currently supports Orvibo S20 sockets only.


  • Get rid of keeping connection to the Orvibo device, which breaks further discover
  • Test under linux platform
  • Consider python 2.7 support
  • Add mac and type cmd line arguments in order decrease execution latency (ver 1.1)
  • API for adding new Orvibo device to the network
  • Python setup script
  • Orvibo s20 event handler
  • Learning and emiting RF 433MHz signal Issue#7


  • Python (tested on Win7 with python 2.7 and python 3.4 and Ubuntu with python 3.2)

Known applications

please let me know about apps not listed here :octocat:


As console app

Overview [-i <ip>] | [-m <mac> -x <socket/irda>] [-s on|off] | [-t <file_to_save_signal>] | [-e <file_with_signal_to_emit>]]

Discover all Orvibo devices in the network

> python
Orvibo[type=socket, ip=, mac='acdf238d1d2e']
Orvibo[type=irda, ip=, mac='accf4378efdc']

Discover device by ip

> python -i
Orvibo[type=socket, ip=, mac='acdf238d1d2e']
Is enabled: True

State of known device [draft]

Faster than just discovering by ip, since discovering step is skipped here. Note: There is no any mac/type validation!

> python -m acdf238d1d2e -x socket
Orvibo[type=socket, ip=unknown, mac='acdf238d1d2e']
Is enabled: True

Same arguments can be used for all examples below.

Switch s20 wifi socket

> python -i -s on
Orvibo[type=socket, ip=, mac='acdf238d1d2e']
Already enabled.

Grab IR code to file

> python -i -t
Orvibo[type=irda, ip=, mac='accf5378dfdc']

Emit already grabed IR code

> python -i -e
Orvibo[type=irda, ip=, mac='accf5378dfdc']

As python module

Discover all devices in the network

from orvibo import Orvibo

for ip in
    print('IP =', ip)

for args in
    device = Orvibo(*args)


IP =
IP =
Orvibo[type=socket, ip=, mac='acdf238d1d2e']
Orvibo[type=irda, ip=, mac='accf4378efdc']

Getting exact device by IP

device ='')


Orvibo[type=socket, ip=, mac='acdf238d1d2e']

Control S20 wifi socket

only for devices with type 'socket'

device = Orvibo('')
print('Is socket enabled: {}'.format(device.on))
device.on = not device.on # Toggle socket
print('Is socket enabled: {}'.format(device.on))


Is socket enabled: True
Is socket enabled: False

Learning AllOne IR blaster

only for devices with type 'irda'

device = Orvibo('')
ir = device.learn('', timeout=15) # AllOne red light is present,
                                           # waiting for ir signal for 15 seconds and stores it to file
if ir is not None:
    # Emit IR code from ""
    # Or with the same result
    # device.emit(ir)

Keeping connection to Orvibo device

By default module doesn't keep connection to the Orvibo device to allow user not thinking about unplanned disconnections from device by whatever reasons (power outage, wifi router reboot, etc). Such behavior actually leads to valuable delay between sending request and applying command on the Orvibo device. Module allows to keep the connection and decrease the latency via setting keep_connection property to True. In this way closing connection and handling socket errors duties lie on orvibo python library user.

import socket

device = Orvibo('')
device.keep_connection = True

def blink_socket(device):
        device.on = not device.on
    except socket.error:
        # Reset connection to device    
        device.keep_connection = True

    # Note: now socket errors are handled by user!

    # Blink the socket ^_^
    for i in range(5):

    # You also may stop using connection anytime
    # device.keep_connection = False
    # Connection must be closed explicitly.
    # via
    # or via
    # device.keep_connection = False