Enabling Siri and Homekit to work with Orvibo S20 Smart Socket
There no shortage of smart sockets there days. Most today can easily work with Apple Homekit. If not, you can then use Homebridge. For some, all you need to do is find the appropriate homebridge plugin, like how I enabled my TP-Link Kasa smart switches to work with Homekit. And then there are the really cheap ones like the Orvibo S20 smart socket which I way back in 2017. There aren’t any plugins that work with the S20 sockets, only the newer S25s. But even so, there is a way to get Siri and Homekit to work with Orvibo S20 smart sockets.

I’ve actually gotten this to work for years. So it’s about time I wrote this up if anyone else might want to do the same.
Homebridge makes our homes a whole lot smarter
Step 1: Install and Setup Homebridge
Firstly, you will need to get Homebridge up and running. It’s really simple and you can find the step-by-step instructions here. They’ve even provided an official Homebridge image for the Raspberry Pi! I run Homebridge on my Raspberry Pi v2 which can be powered by the USB port of my router.

Homebridge now comes with a cool web UI that allows you to configure everything you need just with your web browser. No more fiddling with ssh and vim!
Step 2: Get the Python module to control Orvibo S20 smart socket
I use a python module that allows you to control the Orvibo S20 smart socket from the command line. You can get the python module here: https://github.com/cherezov/orvibo. All you need to do is just download github repository and extract it anywhere on your Raspberry Pi.
Tip: It’s easiest get the module is to clone the git respository directly on your Raspberry Pi.
git clone https://github.com/cherezov/orvibo.git

Once you have the module on your Raspberry Pi, or wherever you are planning to install Homebridge on. You can start using the python orvibo module to get the necessary commands prepared.
I might be stating the obvious, but you will need to have python on the machine to be able to run this. If not already installed, you can find out more here: https://www.python.org/downloads/.
It’s pretty easy to use the python orvibo module. The github page clearly documents how to use the module but the following are the key ones we need.
1. Discovering the Orvibo S20 IP and MAC addresses
Running the following command without providing any parameters returns the list of Orvibo devices discovered in the network.
python orvibo.py

2. Programmatically turning the Orvibo S20 sockets on and off
To turn the Orvibo S20 smart sockets on and off, the following command is how it is done. We will need the IP or MAC addresses that we discovered earlier.
python orvibo.py -i <IP address> -s on python orvibo.py -i <IP address> -s off

Personally, I use IP addresses as I fixed the IP assignments for the Orvibo S20 sockets on my router. Ether one will work just as well.
I also want to point out that there is a delay between the time the command is executed to the time you get the response. This is the same whether you use IP or MAC addresses in the command. This will mean that the when you use the Home app once its all configured, expect a slight delay as well when the sockets responds to your command.
python orvibo.py -m <MAC address> -s on python orvibo.py -m <MAC address> -s off
3. Checking the state of the Orvibo S20 sockets
The Homebridge plugin we would use allows us to set the state of the switch and appropriately show it in the Home app. So it is a good thing that the python Orvibo module also allows us to check the state of the sockets.
python orvibo.py -i <IP address> -x socket

What you want is to have the command return something when the socket is enabled. To do that, all we need to add is a grep command so that it only returns a string when the Orvibo S20 smart socket is enabled.
python orvibo.py -i <IP address> -x socket | grep 'Is enabled: True'

This time, only when the Orvibo S20 socket is enabled, you would see the status.
Step 3: Install and configure the Homebridge Cmdswitch2 plugin
When I was writing this article, I did find a Homebridge plugin that claims to work with the Orvibo S20 smart socket. However, it failed to install on my Homebridge setup. So I can’t really tell if it would actually work. So instead, I used the trusty Cmdswitch2 plugin instead. Homebridge UI makes it really easy to search and install new plugins.
All you need to do is go to the Plugins tab and search for “Cmdswitch2”. When you get the results of the search, just click on INSTALL to get it installed on your Homebridge setup.

Once installed, the next step is to configure Homebridge’s config.json file to use the Cmdswitch2 plugin. To do that, go to the Config tab. There you would see the config file editor.

The screenshot above shows my own configuration. What you are looking for is the platforms section of the json file add in the following after the config section.
There are a few things to note with the Cmdswitch2 configurations.
- Use the absolute path for the orvibo.py file. In my config below, you can see that the location of the python orvibo module is at the /home/pi/orvibo/orvibo directory. Change that accordingly to where you have downloaded it. You can use the pwd command to get the current path where you are at in the terminal.
- Set an appropriate polling internal for the state check. I set mine to 120 seconds and seems to work well for me.
- If you have more than one Orvibo S20 socket, just add in as many as you need as per the example below.
- Tip: Cmdswitch2 plugin works for anything else you can run on the command line! The screenshot above shows how I used it to wake up my PC using WOL. 🙂
- Remember to save the configurations after you have edited it!
... "platforms": [ { "name": "Config", "port": 8581, ... ... }, { "platform": "cmdSwitch2", "name": "CMD Switch", "switches": [ { "name": "<name of your device 1>", "on_cmd": "python /home/pi/orvibo/orvibo.py -i <ip address 1> -s on", "off_cmd": "python /home/pi/orvibo/orvibo.py -i <ip address 1> -s off", "polling": true, "interval": 120, "state_cmd": "python /home/pi/orvibo/orvibo.py -i <ip address 1> -x socket | grep -i 'Is enabled: True'" }, { "name": "<name of your device 2>", "on_cmd": "python /home/pi/orvibo/orvibo.py -i <ip address 2> -s on", "off_cmd": "python /home/pi/orvibo/orvibo.py -i <ip address2 > -s off", "polling": true, "interval": 120, "state_cmd": "python /home/pi/orvibo/orvibo.py -i <ip address2 > -x socket | grep -i 'Is enabled: True'" } ] } ] }
Step 4: Start using Homebridge on Home app!
All you need to do now, (if you’ve not already done so) is to add the Homebridge as a new Accessory on the Home app. If you’re unsure, here’s the simple 3 steps to do so.
- Open the Home app on your device.
- Tap the Home tab, then tap + at the top right corner.
- Tap Add Accessory, then scan the QR code shown in the Homebridge UI
[Source: https://github.com/homebridge/homebridge#adding-homebridge-to-ios]
Once added, you should see your Orvibo S20 smart sockets showing up as generic switches on the Home app! Now, you can go re the switch further on the Home app. As you see below, I’ve configured the generic switch as a fan or a lamp. I’ve also assigned them to the rooms where the sockets are located.


“Hey Siri, turn on the Orvibo S20 Socket”
If everything is all set on the Home app. Then you’re all set to ask Siri to control your Orvibo S20 sockets. 🙂 The only slight annoyance is the delay as its how the python orvibo module works.
Hope this has been useful for you if you have some of those cheap Orvibo S20 smart sockets lying around. Also, Apple Home and Siri sure beats using the ulgy WiWo app that Oribo provides for the old S20 sockets.
